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
5098f0d7
Commit
5098f0d7
authored
Jan 30, 2026
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 提质增效下新建会话后也需要自动调用提问接口
parent
256746af
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
src/layouts/Navbar/Navbar.tsx
+10
-3
No files found.
src/layouts/Navbar/Navbar.tsx
View file @
5098f0d7
...
...
@@ -127,17 +127,22 @@ const NavbarBase: React.FC<NavbarProps & WithAuthProps> = ({ isHistoryVisible, c
?
`/chat/
${
currentConversationId
}
?toolId=
${
currentToolId
}
`
:
`/chat/
${
currentConversationId
}
`
// 通过 location.state 传递 toolId,避免在 Chat 页面被误判为"外链残留参数"而强制清空
// 如果有 shouldSendQuestion,传递 skipHistoryLoad 标记,跳过历史记录加载
// 如果有 shouldSendQuestion 或者是提质增效模式,传递 skipHistoryLoad 标记,跳过历史记录加载
const
isQualityImprovement
=
currentToolId
===
'6712395743241'
navigate
(
url
,
{
state
:
{
toolId
:
currentToolId
||
null
,
skipHistoryLoad
:
Boolean
(
shouldSendQuestion
),
skipHistoryLoad
:
Boolean
(
shouldSendQuestion
)
||
isQualityImprovement
,
},
})
dispatch
(
clearNavigationFlag
())
// 提质增效模式下,创建会话后自动调用提问接口(与 fetchSessionConversationId 后的逻辑保持一致)
if
(
currentToolId
===
'6712395743241'
)
{
// 使用 requestAnimationFrame 确保在下一个渲染周期执行,此时 Chat 组件已经挂载并且 currentIdRef.current 已经更新
if
(
isQualityImprovement
)
{
// 使用双重 requestAnimationFrame 确保在 DOM 更新后执行
requestAnimationFrame
(()
=>
{
requestAnimationFrame
(()
=>
{
window
.
dispatchEvent
(
new
CustomEvent
(
'autoSubmitQuestion'
,
{
detail
:
{
conversationId
:
currentConversationId
,
...
...
@@ -147,6 +152,8 @@ const NavbarBase: React.FC<NavbarProps & WithAuthProps> = ({ isHistoryVisible, c
busiType
:
'01'
,
},
}))
})
})
}
}
},
[
shouldNavigateToNewConversation
,
currentConversationId
,
currentToolId
,
shouldSendQuestion
,
navigate
,
dispatch
])
...
...
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