mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-29 09:44:47 +00:00
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>
|
||||
|
@@ -26,3 +26,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const config = {
|
||||
api: {
|
||||
bodyParser: {
|
||||
sizeLimit: '16mb'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@@ -4,7 +4,7 @@ import { Box, useTheme } from '@chakra-ui/react';
|
||||
import { OutLinkTypeEnum } from '@fastgpt/global/support/outLink/constant';
|
||||
import dynamic from 'next/dynamic';
|
||||
|
||||
import MyRadio from '@/components/Radio';
|
||||
import MyRadio from '@/components/common/MyRadio';
|
||||
import Share from './Share';
|
||||
const API = dynamic(() => import('./API'));
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import React, { useMemo, useState } from 'react';
|
||||
import { Box, type BoxProps, Flex, useTheme, ModalCloseButton } from '@chakra-ui/react';
|
||||
import MyRadio from '@/components/Radio/index';
|
||||
import MyRadio from '@/components/common/MyRadio/index';
|
||||
import dynamic from 'next/dynamic';
|
||||
import ChunkImport from './Chunk';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
|
Reference in New Issue
Block a user