Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
82e7776a
authored
Jul 20, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
configmap
parent
75c8c425
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
19 additions
and
13 deletions
+19
-13
client/src/pages/_app.tsx
+1
-1
client/src/pages/api/system/getInitData.ts
+4
-1
client/src/pages/index.tsx
+1
-1
client/src/pages/login/components/ForgetPasswordForm.tsx
+1
-1
client/src/pages/login/components/LoginForm.tsx
+1
-1
client/src/pages/login/components/RegisterForm.tsx
+1
-1
client/src/service/events/generateQA.ts
+3
-2
client/src/service/utils/sendNote.ts
+7
-5
No files found.
client/src/pages/_app.tsx
View file @
82e7776a
...
...
@@ -52,7 +52,7 @@ function App({ Component, pageProps, isPc }: AppProps & { isPc?: boolean; respon
return
(
<>
<
Head
>
<
title
>
{
feConfigs
?.
systemTitle
||
'
FastAI
'
}
</
title
>
<
title
>
{
feConfigs
?.
systemTitle
||
'
AI知识库
'
}
</
title
>
<
meta
name=
"description"
content=
"Embedding + LLM, Build AI knowledge base"
/>
<
meta
name=
"viewport"
...
...
client/src/pages/api/system/getInitData.ts
View file @
82e7776a
...
...
@@ -17,6 +17,9 @@ export type InitDateResponse = {
};
export
default
async
function
handler
(
req
:
NextApiRequest
,
res
:
NextApiResponse
)
{
if
(
!
global
.
feConfigs
)
{
await
getInitConfig
();
}
jsonRes
<
InitDateResponse
>
(
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'
);
}
}
client/src/pages/index.tsx
View file @
82e7776a
...
...
@@ -168,7 +168,7 @@ const Home = () => {
fontSize=
{
[
'40px'
,
'70px'
]
}
letterSpacing=
{
'5px'
}
>
{
feConfigs
?.
systemTitle
||
'
FastAI
'
}
{
feConfigs
?.
systemTitle
||
'
AI知识库
'
}
</
Box
>
<
Box
className=
{
styles
.
textlg
}
fontWeight=
{
'bold'
}
fontSize=
{
[
'30px'
,
'50px'
]
}
>
可视化 AI 编排
...
...
client/src/pages/login/components/ForgetPasswordForm.tsx
View file @
82e7776a
...
...
@@ -73,7 +73,7 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
return
(
<>
<
Box
fontWeight=
{
'bold'
}
fontSize=
{
'2xl'
}
textAlign=
{
'center'
}
>
找回
FastGPT
账号
找回
{
feConfigs
?.
systemTitle
}
账号
</
Box
>
<
form
onSubmit=
{
handleSubmit
(
onclickFindPassword
)
}
>
<
FormControl
mt=
{
5
}
isInvalid=
{
!!
errors
.
username
}
>
...
...
client/src/pages/login/components/LoginForm.tsx
View file @
82e7776a
...
...
@@ -55,7 +55,7 @@ const LoginForm = ({ setPageType, loginSuccess }: Props) => {
return
(
<>
<
Box
fontWeight=
{
'bold'
}
fontSize=
{
'2xl'
}
textAlign=
{
'center'
}
>
登录
FastGPT
登录
{
feConfigs
?.
systemTitle
}
</
Box
>
<
form
onSubmit=
{
handleSubmit
(
onclickLogin
)
}
>
<
FormControl
mt=
{
8
}
isInvalid=
{
!!
errors
.
username
}
>
...
...
client/src/pages/login/components/RegisterForm.tsx
View file @
82e7776a
...
...
@@ -86,7 +86,7 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
return
(
<>
<
Box
fontWeight=
{
'bold'
}
fontSize=
{
'2xl'
}
textAlign=
{
'center'
}
>
注册
FastGPT
账号
注册
{
feConfigs
?.
systemTitle
}
账号
</
Box
>
<
form
onSubmit=
{
handleSubmit
(
onclickRegister
)
}
>
<
FormControl
mt=
{
5
}
isInvalid=
{
!!
errors
.
username
}
>
...
...
client/src/service/events/generateQA.ts
View file @
82e7776a
...
...
@@ -66,8 +66,9 @@ export async function generateQA(): Promise<any> {
{
role
:
'system'
,
content
:
`你是出题人.
${
data
.
prompt
||
'用户会发送一段长文本'
}
.
从中选出 25 个问题和答案. 答案详细完整. 按格式回答: Q1:
${
data
.
prompt
||
'我会发送一段长文本'
}
.
从中提取出 25 个问题和答案. 答案详细完整. 按下面格式返回:
Q1:
A1:
Q2:
A2:
...
...
client/src/service/utils/sendNote.ts
View file @
82e7776a
...
...
@@ -19,19 +19,21 @@ const mailTransport = nodemailer.createTransport({
const
emailMap
:
{
[
key
:
string
]:
any
}
=
{
[
UserAuthTypeEnum
.
register
]:
{
subject
:
'注册 FastGPT 账号'
,
html
:
(
code
:
string
)
=>
`<div>您正在注册 FastGPT 账号,验证码为:
${
code
}
</div>`
subject
:
`注册
${
global
.
feConfigs
?.
systemTitle
}
账号
`,
html: (code: string) =>
`
<
div
>
您正在注册
$
{
global
.
feConfigs
?.
systemTitle
}
账号,验证码为:
$
{
code
}
<
/div>
`
},
[
UserAuthTypeEnum
.
findPassword
]:
{
subject
:
'修改 FastGPT 密码'
,
html
:
(
code
:
string
)
=>
`<div>您正在修改 FastGPT 账号密码,验证码为:
${
code
}
</div>`
subject
:
`修改
${
global
.
feConfigs
?.
systemTitle
}
密码
`,
html: (code: string) =>
`
<
div
>
您正在修改
$
{
global
.
feConfigs
?.
systemTitle
}
账号密码,验证码为:
$
{
code
}
<
/div>
`
}
};
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)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment