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
06ab718e
authored
May 15, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: share login.
parent
1d740957
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
12 deletions
+32
-12
public/docs/chatProblem.md
+16
-2
src/components/Layout/auth.tsx
+2
-1
src/pages/chat/index.tsx
+5
-3
src/pages/chat/share.tsx
+9
-6
No files found.
public/docs/chatProblem.md
View file @
06ab718e
...
@@ -2,13 +2,27 @@
...
@@ -2,13 +2,27 @@
**请求次数太多了**
**请求次数太多了**
一般是因为自己的 openai 账号异常。请先检查自己的账号是否正常使用。
一般是因为自己的 openai 账号异常。请先检查自己的账号是否正常使用。
**内容长度**
**内容长度**
chatgpt 上下文最长 4096 tokens, 会自动截取上下文,超过 4096 部分会被遗忘。
不同模型上上限不一样,现在全设置为最大上限。
**删除和复制**
**删除和复制**
电脑端:聊天内容右侧有复制和删除的图标。
电脑端:聊天内容右侧有复制和删除的图标。
移动端:点击对话头像,可以选择复制或删除该条内容。
移动端:点击对话头像,可以选择复制或删除该条内容。
**代理出错**
**代理出错**
服务器代理不稳定,可以过一会儿再尝试。 或者可以访问国外服务器:
[
FastGpt
](
https://fastgpt.run/
)
服务器不稳定,可以过一会儿再尝试。 或者可以访问国外服务器:
[
FastGpt
](
https://fastgpt.run/
)
**价格表**
如果使用了自己的 Api Key,不会计费。可以在账号页,看到详细账单。
| 计费项 | 价格: 元/ 1K tokens(包含上下文)|
| --- | --- |
| claude - 对话 | 免费 |
| chatgpt - 对话 | 0.03 |
| gpt4 - 对话 | 0.5 |
| 知识库 - 索引 | 免费 |
| 文件拆分 | 0.03 |
**其他问题**
**其他问题**
请 WX 联系: fastgpt123
请 WX 联系: fastgpt123
| 交流群 | 小助手 |
| 交流群 | 小助手 |
...
...
src/components/Layout/auth.tsx
View file @
06ab718e
...
@@ -7,7 +7,8 @@ import { useQuery } from '@tanstack/react-query';
...
@@ -7,7 +7,8 @@ import { useQuery } from '@tanstack/react-query';
const
unAuthPage
:
{
[
key
:
string
]:
boolean
}
=
{
const
unAuthPage
:
{
[
key
:
string
]:
boolean
}
=
{
'/'
:
true
,
'/'
:
true
,
'/login'
:
true
,
'/login'
:
true
,
'/model/share'
:
true
'/model/share'
:
true
,
'/chat/share'
:
true
};
};
const
Auth
=
({
children
}:
{
children
:
JSX
.
Element
})
=>
{
const
Auth
=
({
children
}:
{
children
:
JSX
.
Element
})
=>
{
...
...
src/pages/chat/index.tsx
View file @
06ab718e
...
@@ -77,7 +77,7 @@ const Chat = ({
...
@@ -77,7 +77,7 @@ const Chat = ({
chatId
:
string
;
chatId
:
string
;
isPcDevice
:
boolean
;
isPcDevice
:
boolean
;
})
=>
{
})
=>
{
const
hasVoiceApi
=
!!
window
.
speechSynthesis
;
const
hasVoiceApi
=
typeof
window
===
'undefined'
?
false
:
!!
window
.
speechSynthesis
;
const
router
=
useRouter
();
const
router
=
useRouter
();
const
theme
=
useTheme
();
const
theme
=
useTheme
();
...
@@ -522,6 +522,8 @@ const Chat = ({
...
@@ -522,6 +522,8 @@ const Chat = ({
status: 'finish'
status: 'finish'
}))
}))
});
});
// have records.
if (res.history.length > 0) {
if (res.history.length > 0) {
setTimeout(() => {
setTimeout(() => {
scrollToBottom('auto');
scrollToBottom('auto');
...
@@ -599,6 +601,7 @@ const Chat = ({
...
@@ -599,6 +601,7 @@ const Chat = ({
AiDetail?: boolean;
AiDetail?: boolean;
}) => (
}) => (
<MenuList fontSize={'sm'} minW={'100px !important'}>
<MenuList fontSize={'sm'} minW={'100px !important'}>
<MenuItem onClick={() => onclickCopy(history.value)}>复制</MenuItem>
{AiDetail && chatData.model.canUse && history.obj === 'AI' && (
{AiDetail && chatData.model.canUse && history.obj === 'AI' && (
<MenuItem
<MenuItem
borderBottom={theme.borders.base}
borderBottom={theme.borders.base}
...
@@ -607,7 +610,6 @@ const Chat = ({
...
@@ -607,7 +610,6 @@ const Chat = ({
AI助手详情
AI助手详情
</MenuItem>
</MenuItem>
)}
)}
<MenuItem onClick={() => onclickCopy(history.value)}>复制</MenuItem>
{hasVoiceApi && (
{hasVoiceApi && (
<MenuItem
<MenuItem
borderBottom={theme.borders.base}
borderBottom={theme.borders.base}
...
@@ -799,7 +801,7 @@ const Chat = ({
...
@@ -799,7 +801,7 @@ const Chat = ({
className="
avatar
"
className="
avatar
"
src={
src={
item.obj === 'Human'
item.obj === 'Human'
? userInfo?.avatar
? userInfo?.avatar
|| '/icon/human.png'
: chatData.model.avatar || LOGO_ICON
: chatData.model.avatar || LOGO_ICON
}
}
alt="
avatar
"
alt="
avatar
"
...
...
src/pages/chat/share.tsx
View file @
06ab718e
...
@@ -70,7 +70,7 @@ const Chat = ({
...
@@ -70,7 +70,7 @@ const Chat = ({
historyId
:
string
;
historyId
:
string
;
isPcDevice
:
boolean
;
isPcDevice
:
boolean
;
})
=>
{
})
=>
{
const
hasVoiceApi
=
!!
window
.
speechSynthesis
;
const
hasVoiceApi
=
typeof
window
===
'undefined'
?
false
:
!!
window
.
speechSynthesis
;
const
router
=
useRouter
();
const
router
=
useRouter
();
const
theme
=
useTheme
();
const
theme
=
useTheme
();
...
@@ -454,16 +454,19 @@ const Chat = ({
...
@@ -454,16 +454,19 @@ const Chat = ({
password
password
});
});
const history = shareChatHistory.find((item) => item._id === historyId)?.chats || [];
setShareChatData({
setShareChatData({
...res,
...res,
history
: shareChatHistory.find((item) => item._id === historyId)?.chats || []
history
});
});
onClosePassword();
onClosePassword();
setTimeout(() => {
history.length > 0 &&
scrollToBottom();
setTimeout(() => {
}, 500);
scrollToBottom();
}, 500);
} catch (e: any) {
} catch (e: any) {
toast({
toast({
status: 'error',
status: 'error',
...
@@ -690,7 +693,7 @@ const Chat = ({
...
@@ -690,7 +693,7 @@ const Chat = ({
className="
avatar
"
className="
avatar
"
src={
src={
item.obj === 'Human'
item.obj === 'Human'
? userInfo?.avatar
? userInfo?.avatar
|| '/icon/human.png'
: shareChatData.model.avatar || LOGO_ICON
: shareChatData.model.avatar || LOGO_ICON
}
}
alt="
avatar
"
alt="
avatar
"
...
...
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