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
3e4b165e
authored
May 11, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: ui
parent
451f234f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
15 deletions
+45
-15
src/api/system.ts
+3
-0
src/pages/api/system/getFiling.ts
+11
-0
src/pages/index.tsx
+8
-3
src/pages/login/components/ForgetPasswordForm.tsx
+3
-3
src/pages/login/components/RegisterForm.tsx
+3
-3
src/pages/login/index.tsx
+1
-1
src/pages/model/components/detail/components/InputDataModal.tsx
+16
-5
No files found.
src/api/system.ts
0 → 100644
View file @
3e4b165e
import
{
GET
,
POST
,
PUT
}
from
'./request'
;
export
const
getFilling
=
()
=>
GET
<
{
beianText
:
string
}
>
(
'/system/getFiling'
);
src/pages/api/system/getFiling.ts
0 → 100644
View file @
3e4b165e
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import
type
{
NextApiRequest
,
NextApiResponse
}
from
'next'
;
import
{
jsonRes
}
from
'@/service/response'
;
export
default
async
function
handler
(
req
:
NextApiRequest
,
res
:
NextApiResponse
)
{
jsonRes
(
res
,
{
data
:
{
beianText
:
process
.
env
.
SAFE_BEIAN_TEXT
||
''
}
});
}
src/pages/index.tsx
View file @
3e4b165e
...
@@ -3,6 +3,8 @@ import { Card, Box, Link } from '@chakra-ui/react';
...
@@ -3,6 +3,8 @@ import { Card, Box, Link } from '@chakra-ui/react';
import
Markdown
from
'@/components/Markdown'
;
import
Markdown
from
'@/components/Markdown'
;
import
{
useMarkdown
}
from
'@/hooks/useMarkdown'
;
import
{
useMarkdown
}
from
'@/hooks/useMarkdown'
;
import
{
useRouter
}
from
'next/router'
;
import
{
useRouter
}
from
'next/router'
;
import
{
getFilling
}
from
'@/api/system'
;
import
{
useQuery
}
from
'@tanstack/react-query'
;
const
Home
=
()
=>
{
const
Home
=
()
=>
{
const
{
inviterId
}
=
useRouter
().
query
as
{
inviterId
:
string
};
const
{
inviterId
}
=
useRouter
().
query
as
{
inviterId
:
string
};
...
@@ -14,6 +16,8 @@ const Home = () => {
...
@@ -14,6 +16,8 @@ const Home = () => {
}
}
},
[
inviterId
]);
},
[
inviterId
]);
const
{
data
:
{
beianText
=
''
}
=
{}
}
=
useQuery
([
'init'
],
getFilling
);
return
(
return
(
<
Box
p=
{
[
5
,
10
]
}
>
<
Box
p=
{
[
5
,
10
]
}
>
<
Card
p=
{
5
}
lineHeight=
{
2
}
>
<
Card
p=
{
5
}
lineHeight=
{
2
}
>
...
@@ -21,11 +25,12 @@ const Home = () => {
...
@@ -21,11 +25,12 @@ const Home = () => {
</
Card
>
</
Card
>
<
Card
p=
{
5
}
mt=
{
4
}
textAlign=
{
'center'
}
>
<
Card
p=
{
5
}
mt=
{
4
}
textAlign=
{
'center'
}
>
<
Box
>
{
beianText
&&
(
<
Link
href=
"https://beian.miit.gov.cn/"
target=
"_blank"
>
<
Link
href=
"https://beian.miit.gov.cn/"
target=
"_blank"
>
浙ICP备2023011255号-1
{
beianText
}
</
Link
>
</
Link
>
</
Box
>
)
}
<
Box
>
Made by FastGpt Team.
</
Box
>
<
Box
>
Made by FastGpt Team.
</
Box
>
</
Card
>
</
Card
>
</
Box
>
</
Box
>
...
...
src/pages/login/components/ForgetPasswordForm.tsx
View file @
3e4b165e
...
@@ -95,7 +95,7 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
...
@@ -95,7 +95,7 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
{
!!
errors
.
username
&&
errors
.
username
.
message
}
{
!!
errors
.
username
&&
errors
.
username
.
message
}
</
FormErrorMessage
>
</
FormErrorMessage
>
</
FormControl
>
</
FormControl
>
<
FormControl
mt=
{
5
}
isInvalid=
{
!!
errors
.
username
}
>
<
FormControl
mt=
{
8
}
isInvalid=
{
!!
errors
.
username
}
>
<
Flex
>
<
Flex
>
<
Input
<
Input
flex=
{
1
}
flex=
{
1
}
...
@@ -121,7 +121,7 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
...
@@ -121,7 +121,7 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
{
!!
errors
.
code
&&
errors
.
code
.
message
}
{
!!
errors
.
code
&&
errors
.
code
.
message
}
</
FormErrorMessage
>
</
FormErrorMessage
>
</
FormControl
>
</
FormControl
>
<
FormControl
mt=
{
5
}
isInvalid=
{
!!
errors
.
password
}
>
<
FormControl
mt=
{
8
}
isInvalid=
{
!!
errors
.
password
}
>
<
Input
<
Input
type=
{
'password'
}
type=
{
'password'
}
placeholder=
"新密码"
placeholder=
"新密码"
...
@@ -142,7 +142,7 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
...
@@ -142,7 +142,7 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
{
!!
errors
.
password
&&
errors
.
password
.
message
}
{
!!
errors
.
password
&&
errors
.
password
.
message
}
</
FormErrorMessage
>
</
FormErrorMessage
>
</
FormControl
>
</
FormControl
>
<
FormControl
mt=
{
5
}
isInvalid=
{
!!
errors
.
password2
}
>
<
FormControl
mt=
{
8
}
isInvalid=
{
!!
errors
.
password2
}
>
<
Input
<
Input
type=
{
'password'
}
type=
{
'password'
}
placeholder=
"确认密码"
placeholder=
"确认密码"
...
...
src/pages/login/components/RegisterForm.tsx
View file @
3e4b165e
...
@@ -103,7 +103,7 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
...
@@ -103,7 +103,7 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
{
!!
errors
.
username
&&
errors
.
username
.
message
}
{
!!
errors
.
username
&&
errors
.
username
.
message
}
</
FormErrorMessage
>
</
FormErrorMessage
>
</
FormControl
>
</
FormControl
>
<
FormControl
mt=
{
5
}
isInvalid=
{
!!
errors
.
username
}
>
<
FormControl
mt=
{
8
}
isInvalid=
{
!!
errors
.
username
}
>
<
Flex
>
<
Flex
>
<
Input
<
Input
flex=
{
1
}
flex=
{
1
}
...
@@ -129,7 +129,7 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
...
@@ -129,7 +129,7 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
{
!!
errors
.
code
&&
errors
.
code
.
message
}
{
!!
errors
.
code
&&
errors
.
code
.
message
}
</
FormErrorMessage
>
</
FormErrorMessage
>
</
FormControl
>
</
FormControl
>
<
FormControl
mt=
{
5
}
isInvalid=
{
!!
errors
.
password
}
>
<
FormControl
mt=
{
8
}
isInvalid=
{
!!
errors
.
password
}
>
<
Input
<
Input
type=
{
'password'
}
type=
{
'password'
}
placeholder=
"密码"
placeholder=
"密码"
...
@@ -150,7 +150,7 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
...
@@ -150,7 +150,7 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
{
!!
errors
.
password
&&
errors
.
password
.
message
}
{
!!
errors
.
password
&&
errors
.
password
.
message
}
</
FormErrorMessage
>
</
FormErrorMessage
>
</
FormControl
>
</
FormControl
>
<
FormControl
mt=
{
5
}
isInvalid=
{
!!
errors
.
password2
}
>
<
FormControl
mt=
{
8
}
isInvalid=
{
!!
errors
.
password2
}
>
<
Input
<
Input
type=
{
'password'
}
type=
{
'password'
}
placeholder=
"确认密码"
placeholder=
"确认密码"
...
...
src/pages/login/index.tsx
View file @
3e4b165e
...
@@ -74,7 +74,7 @@ const Login = ({ isPcDevice }: { isPcDevice: boolean }) => {
...
@@ -74,7 +74,7 @@ const Login = ({ isPcDevice }: { isPcDevice: boolean }) => {
height=
"100%"
height=
"100%"
w=
{
'100%'
}
w=
{
'100%'
}
maxW=
{
'1240px'
}
maxW=
{
'1240px'
}
maxH=
{
[
'auto'
,
'
660px
'
]
}
maxH=
{
[
'auto'
,
'
max(660px,80vh)
'
]
}
backgroundColor=
{
'#fff'
}
backgroundColor=
{
'#fff'
}
alignItems=
{
'center'
}
alignItems=
{
'center'
}
justifyContent=
{
'center'
}
justifyContent=
{
'center'
}
...
...
src/pages/model/components/detail/components/InputDataModal.tsx
View file @
3e4b165e
...
@@ -44,6 +44,13 @@ const InputDataModal = ({
...
@@ -44,6 +44,13 @@ const InputDataModal = ({
*/
*/
const
sureImportData
=
useCallback
(
const
sureImportData
=
useCallback
(
async
(
e
:
FormData
)
=>
{
async
(
e
:
FormData
)
=>
{
if
(
e
.
a
.
length
+
e
.
q
.
length
>=
3000
)
{
toast
({
title
:
'总长度超长了'
,
status
:
'warning'
});
return
;
}
setImporting
(
true
);
setImporting
(
true
);
try
{
try
{
...
@@ -66,7 +73,11 @@ const InputDataModal = ({
...
@@ -66,7 +73,11 @@ const InputDataModal = ({
q
:
''
q
:
''
});
});
onSuccess
();
onSuccess
();
}
catch
(
err
)
{
}
catch
(
err
:
any
)
{
toast
({
title
:
err
?.
message
||
'出现了点意外~'
,
status
:
'error'
});
console
.
log
(
err
);
console
.
log
(
err
);
}
}
setImporting
(
false
);
setImporting
(
false
);
...
@@ -121,8 +132,8 @@ const InputDataModal = ({
...
@@ -121,8 +132,8 @@ const InputDataModal = ({
<
Box
flex=
{
1
}
mr=
{
[
0
,
4
]
}
mb=
{
[
4
,
0
]
}
h=
{
[
'230px'
,
'100%'
]
}
>
<
Box
flex=
{
1
}
mr=
{
[
0
,
4
]
}
mb=
{
[
4
,
0
]
}
h=
{
[
'230px'
,
'100%'
]
}
>
<
Box
h=
{
'30px'
}
>
{
'匹配的知识点'
}
</
Box
>
<
Box
h=
{
'30px'
}
>
{
'匹配的知识点'
}
</
Box
>
<
Textarea
<
Textarea
placeholder=
{
'匹配的知识点。这部分内容会被搜索,请把控内容的质量。
最多 15
00 字。'
}
placeholder=
{
'匹配的知识点。这部分内容会被搜索,请把控内容的质量。
总和最多 30
00 字。'
}
maxLength=
{
15
00
}
maxLength=
{
30
00
}
resize=
{
'none'
}
resize=
{
'none'
}
h=
{
'calc(100% - 30px)'
}
h=
{
'calc(100% - 30px)'
}
{
...
register
(`
q
`,
{
{
...
register
(`
q
`,
{
...
@@ -134,9 +145,9 @@ const InputDataModal = ({
...
@@ -134,9 +145,9 @@ const InputDataModal = ({
<
Box
h=
{
'30px'
}
>
补充知识
</
Box
>
<
Box
h=
{
'30px'
}
>
补充知识
</
Box
>
<
Textarea
<
Textarea
placeholder=
{
placeholder=
{
'补充知识。这部分内容不会被搜索,但会作为"匹配的知识点"的内容补充,你可以讲一些细节的内容填写在这里。
最多 15
00 字。'
'补充知识。这部分内容不会被搜索,但会作为"匹配的知识点"的内容补充,你可以讲一些细节的内容填写在这里。
总和最多 30
00 字。'
}
}
maxLength=
{
15
00
}
maxLength=
{
30
00
}
resize=
{
'none'
}
resize=
{
'none'
}
h=
{
'calc(100% - 30px)'
}
h=
{
'calc(100% - 30px)'
}
{
...
register
('
a
')}
{
...
register
('
a
')}
...
...
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