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
d9450bd7
authored
Jun 09, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: sharechat message;fix: user balance
parent
69bb1f3f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
9 deletions
+55
-9
docs/deploy/fastgpt/docker-compose.yml
+0
-3
docs/dev/.env.template
+33
-0
src/pages/chat/index.tsx
+5
-3
src/pages/chat/share.tsx
+10
-0
src/pages/number/index.tsx
+5
-1
src/store/user.ts
+2
-2
No files found.
docs/deploy/fastgpt/docker-compose.yml
View file @
d9450bd7
...
@@ -79,9 +79,6 @@ services:
...
@@ -79,9 +79,6 @@ services:
-
GPT4KEY=sk-xxx
-
GPT4KEY=sk-xxx
-
OPENAI_BASE_URL=https://api.openai.com/v1
-
OPENAI_BASE_URL=https://api.openai.com/v1
-
OPENAI_BASE_URL_AUTH=可选的安全凭证
-
OPENAI_BASE_URL_AUTH=可选的安全凭证
# claude
-
CLAUDE_BASE_URL=calude模型请求地址
-
CLAUDE_KEY=CLAUDE_KEY
nginx
:
nginx
:
image
:
nginx:alpine3.17
image
:
nginx:alpine3.17
container_name
:
nginx
container_name
:
nginx
...
...
docs/dev/.env.template
0 → 100644
View file @
d9450bd7
# 运行端口,如果不是 3000 口运行,需要改成其他的。注意:不是改了这个变量就会变成其他端口,而是因为改成其他端口,才用这个变量。
PORT=3000
# 代理
# AXIOS_PROXY_HOST=127.0.0.1
# AXIOS_PROXY_PORT=7890
# email
MY_MAIL=xxx@qq.com
MAILE_CODE=xxx
# ali ems
aliAccessKeyId=xxx
aliAccessKeySecret=xxx
aliSignName=xxx
aliTemplateCode=SMS_xxx
# token
TOKEN_KEY=xxx
# root key, 最高权限
ROOT_KEY=xxx
# 是否进行安全校验(1: 开启,0: 关闭)
SENSITIVE_CHECK=1
# openai
# OPENAI_BASE_URL=https://api.openai.com/v1
# OPENAI_BASE_URL_AUTH=可选的安全凭证(不需要的时候,记得去掉)
OPENAIKEY=sk-xxx # 对话用的key
OPENAI_TRAINING_KEY=sk-xxx # 训练用的key
GPT4KEY=sk-xxx
# db
MONGODB_URI=mongodb://username:password@0.0.0.0:27017/test?authSource=admin
PG_HOST=0.0.0.0
PG_PORT=8100
PG_USER=xxx
PG_PASSWORD=xxx
PG_DB_NAME=xxx
\ No newline at end of file
src/pages/chat/index.tsx
View file @
d9450bd7
...
@@ -229,9 +229,11 @@ const Chat = ({ modelId, chatId }: { modelId: string; chatId: string }) => {
...
@@ -229,9 +229,11 @@ const Chat = ({ modelId, chatId }: { modelId: string; chatId: string }) => {
}));
}));
// refresh data
// refresh data
generatingMessage
();
setTimeout
(()
=>
{
loadHistory
({
pageNum
:
1
,
init
:
true
});
generatingMessage
();
loadMyModels
(
true
);
loadHistory
({
pageNum
:
1
,
init
:
true
});
loadMyModels
(
true
);
},
100
);
},
},
[
[
chatId
,
chatId
,
...
...
src/pages/chat/share.tsx
View file @
d9450bd7
...
@@ -231,6 +231,16 @@ const Chat = ({ shareId, historyId }: { shareId: string; historyId: string }) =>
...
@@ -231,6 +231,16 @@ const Chat = ({ shareId, historyId }: { shareId: string; historyId: string }) =>
chats
:
responseHistory
chats
:
responseHistory
});
});
window
.
top
?.
postMessage
(
{
type
:
'shareChatFinish'
,
data
:
{
responseText
}
},
'*'
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
generatingMessage
();
generatingMessage
();
},
100
);
},
100
);
...
...
src/pages/number/index.tsx
View file @
d9450bd7
...
@@ -141,7 +141,11 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
...
@@ -141,7 +141,11 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
router
.
replace
(
'/login'
);
router
.
replace
(
'/login'
);
},
[
router
,
setUserInfo
]);
},
[
router
,
setUserInfo
]);
useQuery
([
'init'
],
initUserInfo
);
useQuery
([
'init'
],
initUserInfo
,
{
onSuccess
(
res
)
{
reset
(
res
);
}
});
const
{
data
:
{
invitedAmount
=
0
,
historyAmount
=
0
,
residueAmount
=
0
}
=
{}
}
=
useQuery
(
const
{
data
:
{
invitedAmount
=
0
,
historyAmount
=
0
,
residueAmount
=
0
}
=
{}
}
=
useQuery
(
[
'getPromotionInitData'
],
[
'getPromotionInitData'
],
getPromotionInitData
getPromotionInitData
...
...
src/store/user.ts
View file @
d9450bd7
...
@@ -14,7 +14,7 @@ import type { ModelSchema } from '@/types/mongoSchema';
...
@@ -14,7 +14,7 @@ import type { ModelSchema } from '@/types/mongoSchema';
type
State
=
{
type
State
=
{
userInfo
:
UserType
|
null
;
userInfo
:
UserType
|
null
;
initUserInfo
:
()
=>
Promise
<
null
>
;
initUserInfo
:
()
=>
Promise
<
UserType
>
;
setUserInfo
:
(
user
:
UserType
|
null
)
=>
void
;
setUserInfo
:
(
user
:
UserType
|
null
)
=>
void
;
updateUserInfo
:
(
user
:
UserUpdateParams
)
=>
void
;
updateUserInfo
:
(
user
:
UserUpdateParams
)
=>
void
;
// model
// model
...
@@ -47,7 +47,7 @@ export const useUserStore = create<State>()(
...
@@ -47,7 +47,7 @@ export const useUserStore = create<State>()(
async
initUserInfo
()
{
async
initUserInfo
()
{
const
res
=
await
getTokenLogin
();
const
res
=
await
getTokenLogin
();
get
().
setUserInfo
(
res
);
get
().
setUserInfo
(
res
);
return
null
;
return
res
;
},
},
setUserInfo
(
user
:
UserType
|
null
)
{
setUserInfo
(
user
:
UserType
|
null
)
{
set
((
state
)
=>
{
set
((
state
)
=>
{
...
...
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