Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sdream-ai-fe
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
侯明涛
sdream-ai-fe
Commits
b57c7782
Commit
b57c7782
authored
Dec 08, 2025
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete:无用代码
parent
6bf7f2b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
21 deletions
+1
-21
src/layouts/HistoryBar/components/HistoryBarList/index.tsx
+0
-2
src/pages/Chat/Chat.tsx
+1
-19
No files found.
src/layouts/HistoryBar/components/HistoryBarList/index.tsx
View file @
b57c7782
...
@@ -33,8 +33,6 @@ export const HistoryBarList: React.FC<HistoryBarListProps> = ({ searchValue, onS
...
@@ -33,8 +33,6 @@ export const HistoryBarList: React.FC<HistoryBarListProps> = ({ searchValue, onS
})
})
if
(
conversation
.
toolId
)
{
if
(
conversation
.
toolId
)
{
sessionStorage
.
setItem
(
'currentToolId'
,
conversation
.
toolId
)
sessionStorage
.
setItem
(
'currentToolId'
,
conversation
.
toolId
)
// eslint-disable-next-line no-console
console
.
log
(
'889999999999:'
,
conversation
.
toolId
)
dispatch
(
setCurrentToolId
(
conversation
.
toolId
))
dispatch
(
setCurrentToolId
(
conversation
.
toolId
))
}
}
else
{
else
{
...
...
src/pages/Chat/Chat.tsx
View file @
b57c7782
...
@@ -12,8 +12,7 @@ import { ChatEditor } from '@/components/ChatEditor'
...
@@ -12,8 +12,7 @@ import { ChatEditor } from '@/components/ChatEditor'
import
type
{
ChatRecord
}
from
'@/types/chat'
import
type
{
ChatRecord
}
from
'@/types/chat'
import
{
fetchUserQaRecordPage
}
from
'@/api/conversation'
import
{
fetchUserQaRecordPage
}
from
'@/api/conversation'
import
{
fetchCheckTokenApi
,
fetchStreamResponse
}
from
'@/api/chat'
import
{
fetchCheckTokenApi
,
fetchStreamResponse
}
from
'@/api/chat'
import
{
fetchEfficiencyQuestionList
,
fetchToolList
}
from
'@/api/home'
import
{
fetchToolList
}
from
'@/api/home'
// import { mockFetchToolList } from '@/api/mock/home'
import
{
clearCurrentToolId
,
clearShouldSendQuestion
,
fetchConversations
,
setCurrentToolId
}
from
'@/store/conversationSlice'
import
{
clearCurrentToolId
,
clearShouldSendQuestion
,
fetchConversations
,
setCurrentToolId
}
from
'@/store/conversationSlice'
import
{
getUserRolesForApi
}
from
'@/lib/utils'
import
{
getUserRolesForApi
}
from
'@/lib/utils'
import
type
{
RootState
}
from
'@/store'
import
type
{
RootState
}
from
'@/store'
...
@@ -93,23 +92,6 @@ export const Chat: React.FC = () => {
...
@@ -93,23 +92,6 @@ export const Chat: React.FC = () => {
sessionToolId
:
null
,
sessionToolId
:
null
,
})
})
// 首次进入 /chat/:id 时,拉取一次通用模式下的常见问题(toolId: ''),后续仍按现有逻辑走
useEffect
(()
=>
{
;(
async
()
=>
{
try
{
// 仅在本标签页首次进入时调用一次
if
(
sessionStorage
.
getItem
(
'__INITIAL_FAQ_LOADED__'
))
return
sessionStorage
.
setItem
(
'__INITIAL_FAQ_LOADED__'
,
'true'
)
const
sessionToolId
=
sessionStorage
.
getItem
(
'currentToolId'
)
||
''
await
fetchEfficiencyQuestionList
({
toolId
:
sessionToolId
})
}
catch
(
error
)
{
console
.
error
(
'初始化通用模式常见问题失败:'
,
error
)
}
})()
},
[])
// 进入聊天页时,同步当前链接和缓存中的 toolId 到页面上展示
// 进入聊天页时,同步当前链接和缓存中的 toolId 到页面上展示
useEffect
(()
=>
{
useEffect
(()
=>
{
try
{
try
{
...
...
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