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
5b51f76d
Commit
5b51f76d
authored
Jan 12, 2026
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:历史记录进入会话时提问接口参数
parent
3924711e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
src/pages/Chat/Chat.tsx
+10
-9
No files found.
src/pages/Chat/Chat.tsx
View file @
5b51f76d
...
@@ -262,6 +262,12 @@ export const Chat: React.FC = () => {
...
@@ -262,6 +262,12 @@ export const Chat: React.FC = () => {
requestBody
.
busiType
=
'01'
requestBody
.
busiType
=
'01'
requestBody
.
recordType
=
'01'
requestBody
.
recordType
=
'01'
}
}
// 兜底逻辑:如果 toolId 不在预期范围内,默认使用制度活化的参数
else
{
requestBody
.
toolId
=
resolvedToolId
requestBody
.
busiType
=
'01'
requestBody
.
recordType
=
'01'
}
fetchStreamResponse
(
fetchStreamResponse
(
fetchUrl
,
fetchUrl
,
...
@@ -406,22 +412,17 @@ export const Chat: React.FC = () => {
...
@@ -406,22 +412,17 @@ export const Chat: React.FC = () => {
// 只有当 Redux 中的 toolId 与最终确定的 toolId 不一致时,才更新
// 只有当 Redux 中的 toolId 与最终确定的 toolId 不一致时,才更新
if
(
currentToolId
!==
toolIdFromState
)
{
if
(
currentToolId
!==
toolIdFromState
)
{
dispatch
(
setCurrentToolId
(
toolIdFromState
))
dispatch
(
setCurrentToolId
(
toolIdFromState
))
// 从收藏返回时,同步到 sessionStorage,避免 ChatEditor 清除 toolId
if
(
fromCollect
)
{
sessionStorage
.
setItem
(
'currentToolId'
,
toolIdFromState
)
}
}
else
{
if
(
fromCollect
&&
!
sessionStorage
.
getItem
(
'currentToolId'
))
{
sessionStorage
.
setItem
(
'currentToolId'
,
toolIdFromState
)
}
}
}
// 无条件同步到 sessionStorage,确保 ChatEditor 和 handleSubmitQuestion 能获取到正确的 toolId
sessionStorage
.
setItem
(
'currentToolId'
,
toolIdFromState
)
}
}
else
{
else
{
// 如果从 location.state 传递的是 null,清除 toolId
// 如果从 location.state 传递的是 null,清除 toolId
if
(
currentToolId
)
{
if
(
currentToolId
)
{
dispatch
(
clearCurrentToolId
())
dispatch
(
clearCurrentToolId
())
}
}
// 清除 sessionStorage,确保制度活化模式正确
sessionStorage
.
removeItem
(
'currentToolId'
)
}
}
// 清除 ref,避免下次路由变化时误用
// 清除 ref,避免下次路由变化时误用
toolIdFromStateRef
.
current
=
undefined
toolIdFromStateRef
.
current
=
undefined
...
...
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