From 82e7776a77525f73c88b86dbff3f55575dd56dee Mon Sep 17 00:00:00 2001 From: archer <545436317@qq.com> Date: Thu, 20 Jul 2023 10:34:54 +0800 Subject: [PATCH] configmap --- client/src/pages/_app.tsx | 2 +- client/src/pages/api/system/getInitData.ts | 5 ++++- client/src/pages/index.tsx | 2 +- .../pages/login/components/ForgetPasswordForm.tsx | 2 +- client/src/pages/login/components/LoginForm.tsx | 2 +- client/src/pages/login/components/RegisterForm.tsx | 2 +- client/src/service/events/generateQA.ts | 5 +++-- client/src/service/utils/sendNote.ts | 12 +++++++----- 8 files changed, 19 insertions(+), 13 deletions(-) diff --git a/client/src/pages/_app.tsx b/client/src/pages/_app.tsx index 7fc40e8be..52627772f 100644 --- a/client/src/pages/_app.tsx +++ b/client/src/pages/_app.tsx @@ -52,7 +52,7 @@ function App({ Component, pageProps, isPc }: AppProps & { isPc?: boolean; respon return ( <> - {feConfigs?.systemTitle || 'FastAI'} + {feConfigs?.systemTitle || 'AI知识库'} (res, { data: { systemEnv: global.systemEnv, @@ -39,6 +42,6 @@ export async function getInitConfig() { global.qaModels = res.QAModels; global.vectorModels = res.VectorModels; } catch (error) { - console.log('get init config error'); + return Promise.reject('get init config error'); } } diff --git a/client/src/pages/index.tsx b/client/src/pages/index.tsx index cebe33570..ca25d468b 100644 --- a/client/src/pages/index.tsx +++ b/client/src/pages/index.tsx @@ -168,7 +168,7 @@ const Home = () => { fontSize={['40px', '70px']} letterSpacing={'5px'} > - {feConfigs?.systemTitle || 'FastAI'} + {feConfigs?.systemTitle || 'AI知识库'} 可视化 AI 编排 diff --git a/client/src/pages/login/components/ForgetPasswordForm.tsx b/client/src/pages/login/components/ForgetPasswordForm.tsx index 03098bb35..fd3557672 100644 --- a/client/src/pages/login/components/ForgetPasswordForm.tsx +++ b/client/src/pages/login/components/ForgetPasswordForm.tsx @@ -73,7 +73,7 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => { return ( <> - 找回 FastGPT 账号 + 找回 {feConfigs?.systemTitle} 账号
diff --git a/client/src/pages/login/components/LoginForm.tsx b/client/src/pages/login/components/LoginForm.tsx index f1730b8a1..29db9a666 100644 --- a/client/src/pages/login/components/LoginForm.tsx +++ b/client/src/pages/login/components/LoginForm.tsx @@ -55,7 +55,7 @@ const LoginForm = ({ setPageType, loginSuccess }: Props) => { return ( <> - 登录 FastGPT + 登录 {feConfigs?.systemTitle} diff --git a/client/src/pages/login/components/RegisterForm.tsx b/client/src/pages/login/components/RegisterForm.tsx index 15d8d6af2..92bc7503e 100644 --- a/client/src/pages/login/components/RegisterForm.tsx +++ b/client/src/pages/login/components/RegisterForm.tsx @@ -86,7 +86,7 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => { return ( <> - 注册 FastGPT 账号 + 注册 {feConfigs?.systemTitle} 账号 diff --git a/client/src/service/events/generateQA.ts b/client/src/service/events/generateQA.ts index 184e0c8cd..d3527b3a0 100644 --- a/client/src/service/events/generateQA.ts +++ b/client/src/service/events/generateQA.ts @@ -66,8 +66,9 @@ export async function generateQA(): Promise { { role: 'system', content: `你是出题人. -${data.prompt || '用户会发送一段长文本'}. -从中选出 25 个问题和答案. 答案详细完整. 按格式回答: Q1: +${data.prompt || '我会发送一段长文本'}. +从中提取出 25 个问题和答案. 答案详细完整. 按下面格式返回: +Q1: A1: Q2: A2: diff --git a/client/src/service/utils/sendNote.ts b/client/src/service/utils/sendNote.ts index b2dc0e1a9..3ce0f964a 100644 --- a/client/src/service/utils/sendNote.ts +++ b/client/src/service/utils/sendNote.ts @@ -19,19 +19,21 @@ const mailTransport = nodemailer.createTransport({ const emailMap: { [key: string]: any } = { [UserAuthTypeEnum.register]: { - subject: '注册 FastGPT 账号', - html: (code: string) => `
您正在注册 FastGPT 账号,验证码为:${code}
` + subject: `注册 ${global.feConfigs?.systemTitle} 账号`, + html: (code: string) => + `
您正在注册 ${global.feConfigs?.systemTitle} 账号,验证码为:${code}
` }, [UserAuthTypeEnum.findPassword]: { - subject: '修改 FastGPT 密码', - html: (code: string) => `
您正在修改 FastGPT 账号密码,验证码为:${code}
` + subject: `修改 ${global.feConfigs?.systemTitle} 密码`, + html: (code: string) => + `
您正在修改 ${global.feConfigs?.systemTitle} 账号密码,验证码为:${code}
` } }; export const sendEmailCode = (email: string, code: string, type: `${UserAuthTypeEnum}`) => { return new Promise((resolve, reject) => { const options = { - from: `"FastGPT" ${myEmail}`, + from: `"${global.feConfigs?.systemTitle}" ${myEmail}`, to: email, subject: emailMap[type]?.subject, html: emailMap[type]?.html(code)