system title (#526)

This commit is contained in:
Archer
2023-11-29 10:56:53 +08:00
committed by GitHub
parent abc1e576b7
commit 007fce2deb
10 changed files with 24 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
import { useEffect, useState } from 'react';
import { useEffect, useRef, useState } from 'react';
import type { AppProps } from 'next/app';
import Script from 'next/script';
import Head from 'next/head';
@@ -39,16 +39,18 @@ function App({ Component, pageProps }: AppProps) {
const router = useRouter();
const { hiId } = router.query as { hiId?: string };
const { i18n } = useTranslation();
const { setLastRoute } = useSystemStore();
const [scripts, setScripts] = useState<FeConfigsType['scripts']>([]);
const [title, setTitle] = useState(process.env.SYSTEM_NAME || 'AI');
useEffect(() => {
// get init data
(async () => {
const {
feConfigs: { scripts, isPlus }
feConfigs: { scripts, isPlus, systemTitle }
} = await clientInitData();
setTitle(systemTitle || 'FastGPT');
// log fastgpt
!isPlus &&
console.log(
@@ -90,8 +92,6 @@ function App({ Component, pageProps }: AppProps) {
hiId && localStorage.setItem('inviterId', hiId);
}, [hiId]);
const title = feConfigs?.systemTitle || process.env.SYSTEM_NAME || '';
return (
<>
<Head>