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
e12f97a7
authored
Mar 14, 2023
by
Archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 文案提示;删除账号
parent
7f96c4ff
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
26 additions
and
26 deletions
+26
-26
Makefile
+3
-3
README.md
+3
-3
next.config.js
+1
-11
package.json
+1
-1
src/constants/common.ts
+2
-2
src/pages/chat/index.tsx
+2
-2
src/pages/number/setting.tsx
+12
-2
src/service/utils/chat.ts
+1
-1
src/utils/user.ts
+1
-1
No files found.
Makefile
View file @
e12f97a7
SERVICE_NAME
=
doc
-gpt
SERVICE_NAME
=
fast
-gpt
# Image URL to use all building/pushing image targets
IMG
?=
$(SERVICE_NAME)
:latest
...
...
@@ -34,13 +34,13 @@ run: ## Run a dev service from host.
.PHONY
:
docker-build
docker-build
:
##
Build docker image with the desktop-frontend.
docker build
-t
c121914yu/
doc
-gpt:latest .
docker build
-t
c121914yu/
fast
-gpt:latest .
##@ Deployment
.PHONY
:
docker-run
docker-run
:
##
Push docker image.
docker run
-d
-p
8008:3000
--name
doc-gpt
-v
/web_project/yjl/doc-gpt/logs:/app/.next/logs c121914yu/doc
-gpt:latest
docker run
-d
-p
8008:3000
--name
fast-gpt
-v
/web_project/yjl/fast-gpt/logs:/app/.next/logs c121914yu/fast
-gpt:latest
#TODO: add support of docker push
...
...
README.md
View file @
e12f97a7
...
...
@@ -34,9 +34,9 @@ docker push imageName:tag
```
bash
# 服务器拉取部署, imageName 替换成镜像名
docker pull imageName:tag
docker stop
doc
-gpt
||
true
docker rm
doc
-gpt
||
true
docker run
-d
--network
=
host
--name
doc
-gpt
\
docker stop
fast
-gpt
||
true
docker rm
fast
-gpt
||
true
docker run
-d
--network
=
host
--name
fast
-gpt
\
-e
AXIOS_PROXY_HOST
=
127.0.0.1
\
-e
AXIOS_PROXY_PORT
=
7890
\
-e
MY_MAIL
=
your email
\
...
...
next.config.js
View file @
e12f97a7
...
...
@@ -6,17 +6,7 @@ const isDev = process.env.NODE_ENV === 'development';
const
nextConfig
=
{
output
:
'standalone'
,
reactStrictMode
:
false
,
compress
:
true
,
images
:
{
remotePatterns
:
[
{
protocol
:
'https'
,
hostname
:
'docgpt-1301319986.cos.ap-shanghai.myqcloud.com'
,
port
:
''
,
pathname
:
'/**'
}
]
}
compress
:
true
};
module
.
exports
=
nextConfig
;
package.json
View file @
e12f97a7
{
"name"
:
"
doc
gpt
"
,
"name"
:
"
fast
gpt
"
,
"version"
:
"0.1.0"
,
"private"
:
true
,
"scripts"
:
{
...
...
src/constants/common.ts
View file @
e12f97a7
...
...
@@ -4,9 +4,9 @@ export enum EmailTypeEnum {
}
export
const
introPage
=
`
## 欢迎使用
Doc
GPT
## 欢迎使用
Fast
GPT
[Git 仓库](https://github.com/c121914yu/
Doc
GPT)
[Git 仓库](https://github.com/c121914yu/
Fast
GPT)
时间比较赶,介绍没来得及完善,先直接上怎么使用:
1. 使用邮箱注册账号。
...
...
src/pages/chat/index.tsx
View file @
e12f97a7
...
...
@@ -243,9 +243,9 @@ const Chat = ({ chatId, windowId }: { chatId: string; windowId?: string }) => {
if
(
typeof
fnMap
[
chatSiteData
.
chatModel
]
===
'function'
)
{
await
fnMap
[
chatSiteData
.
chatModel
](
requestPrompt
);
}
}
catch
(
err
)
{
}
catch
(
err
:
any
)
{
toast
({
title
:
typeof
err
===
'string'
?
err
:
'聊天出错了~'
,
title
:
typeof
err
===
'string'
?
err
:
err
?.
message
||
'聊天出错了~'
,
status
:
'warning'
,
duration
:
5000
,
isClosable
:
true
...
...
src/pages/number/setting.tsx
View file @
e12f97a7
...
...
@@ -12,8 +12,10 @@ import {
Td
,
TableContainer
,
Select
,
Input
Input
,
IconButton
}
from
'@chakra-ui/react'
;
import
{
DeleteIcon
}
from
'@chakra-ui/icons'
;
import
{
useForm
,
useFieldArray
}
from
'react-hook-form'
;
import
{
UserUpdateParams
}
from
'@/types/user'
;
import
{
putUserInfo
}
from
'@/api/user'
;
...
...
@@ -130,7 +132,15 @@ const NumberSetting = () => {
></
Input
>
</
Td
>
<
Td
>
<
Button
onClick=
{
()
=>
removeAccount
(
i
)
}
>
删除
</
Button
>
<
IconButton
aria
-
label=
"删除账号"
icon=
{
<
DeleteIcon
/>
}
colorScheme=
{
'red'
}
onClick=
{
()
=>
{
removeAccount
(
i
);
handleSubmit
(
onclickSave
)();
}
}
/>
</
Td
>
</
Tr
>
))
}
...
...
src/service/utils/chat.ts
View file @
e12f97a7
...
...
@@ -35,7 +35,7 @@ export const authChat = async (chatId: string) => {
const
userApiKey
=
user
.
accounts
?.
find
((
item
:
any
)
=>
item
.
type
===
'openai'
)?.
value
;
if
(
!
userApiKey
)
{
return
Promise
.
reject
(
'
该用户
缺少ApiKey, 无法请求'
);
return
Promise
.
reject
(
'缺少ApiKey, 无法请求'
);
}
return
{
...
...
src/utils/user.ts
View file @
e12f97a7
const
tokenKey
=
'
doc
-gpt-token'
;
const
tokenKey
=
'
fast
-gpt-token'
;
export
const
setToken
=
(
val
:
string
)
=>
{
localStorage
.
setItem
(
tokenKey
,
val
);
...
...
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