system title (#526)
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user