From c46a37541c1b76b75d519f3b3cc79cc2ee585235 Mon Sep 17 00:00:00 2001 From: archer <545436317@qq.com> Date: Wed, 19 Jul 2023 11:17:08 +0800 Subject: [PATCH] perf: config fe --- client/data/FeConfig.json | 14 +++--- client/src/components/ChatBox/index.tsx | 2 +- client/src/components/Layout/navbar.tsx | 4 +- client/src/pages/_app.tsx | 5 +-- client/src/pages/api/user/sendAuthCode.ts | 2 +- client/src/pages/index.tsx | 44 +++++++++---------- .../src/pages/login/components/LoginForm.tsx | 19 ++++---- client/src/pages/number/index.tsx | 6 +-- client/src/pages/tools/index.tsx | 4 +- client/src/types/index.d.ts | 2 +- 10 files changed, 52 insertions(+), 50 deletions(-) diff --git a/client/data/FeConfig.json b/client/data/FeConfig.json index 8a2b55763..223ea265f 100644 --- a/client/data/FeConfig.json +++ b/client/data/FeConfig.json @@ -1,9 +1,9 @@ { - "show_emptyChat": false, - "show_register": false, - "show_appStore": false, - "show_promotion": false, - "show_userDetail": false, - "show_git": false, - "authorText": "Made by FastGpt Team." + "show_emptyChat": true, + "show_register": true, + "show_appStore": true, + "show_userDetail": true, + "show_git": true, + "systemTitle": "FastAI", + "authorText": "Made by FastAI Team." } diff --git a/client/src/components/ChatBox/index.tsx b/client/src/components/ChatBox/index.tsx index 2f3c14159..1c0cf869b 100644 --- a/client/src/components/ChatBox/index.tsx +++ b/client/src/components/ChatBox/index.tsx @@ -394,7 +394,7 @@ const ChatBox = ( const showEmpty = useMemo( () => - feConfigs.show_emptyChat && + feConfigs?.show_emptyChat && showEmptyIntro && chatHistory.length === 0 && !variableModules?.length && diff --git a/client/src/components/Layout/navbar.tsx b/client/src/components/Layout/navbar.tsx index c1ddaeb26..0a56cfd54 100644 --- a/client/src/components/Layout/navbar.tsx +++ b/client/src/components/Layout/navbar.tsx @@ -42,7 +42,7 @@ const Navbar = ({ unread }: { unread: number }) => { link: `/kb/list`, activeLink: ['/kb/list', '/kb/detail'] }, - ...(feConfigs.show_appStore + ...(feConfigs?.show_appStore ? [ { label: '市场', @@ -143,7 +143,7 @@ const Navbar = ({ unread }: { unread: number }) => { )} - {feConfigs.show_git && ( + {feConfigs?.show_git && ( NProgress.start()); @@ -51,7 +50,7 @@ function App({ Component, pageProps, isPc }: AppProps & { isPc?: boolean; respon return ( <> - Fast GPT + {feConfigs?.systemTitle || 'FastAI'} { fontSize={['40px', '70px']} letterSpacing={'5px'} > - FastAI + {feConfigs?.systemTitle || 'FastAI'} 可视化 AI 编排 @@ -180,25 +178,27 @@ const Home = () => { - + {feConfigs?.show_git && ( + + )}