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>

View File

@@ -26,3 +26,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
});
}
}
export const config = {
api: {
bodyParser: {
sizeLimit: '16mb'
}
}
};

View File

@@ -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'));

View File

@@ -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';