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
d19da468
Commit
d19da468
authored
Dec 11, 2025
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:只在sso_login 时调用初始化常见问题接口
parent
d2762443
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
10 deletions
+2
-10
src/pages/Home/HomeNew.tsx
+2
-10
No files found.
src/pages/Home/HomeNew.tsx
View file @
d19da468
...
@@ -262,7 +262,7 @@ export const Home: React.FC = () => {
...
@@ -262,7 +262,7 @@ export const Home: React.FC = () => {
window
.
dispatchEvent
(
new
CustomEvent
(
'forceResetToGeneralMode'
))
window
.
dispatchEvent
(
new
CustomEvent
(
'forceResetToGeneralMode'
))
initConversation
()
initConversation
()
dispatch
(
fetchConversations
())
dispatch
(
fetchConversations
())
//
登录成功后再拉取一次
常见问题,强制 toolId 为空
//
sso_login 成功后,首次拉取
常见问题,强制 toolId 为空
handleInitialQuestions
()
handleInitialQuestions
()
}
}
}
}
...
@@ -311,8 +311,6 @@ export const Home: React.FC = () => {
...
@@ -311,8 +311,6 @@ export const Home: React.FC = () => {
window
.
dispatchEvent
(
new
CustomEvent
(
'forceResetToGeneralMode'
))
window
.
dispatchEvent
(
new
CustomEvent
(
'forceResetToGeneralMode'
))
initConversation
()
initConversation
()
dispatch
(
fetchConversations
())
dispatch
(
fetchConversations
())
// 登录成功后再拉取一次常见问题,强制 toolId 为空
handleInitialQuestions
()
}
}
}
}
},
[
setToken
,
dispatch
,
handleInitialQuestions
])
},
[
setToken
,
dispatch
,
handleInitialQuestions
])
...
@@ -324,14 +322,8 @@ export const Home: React.FC = () => {
...
@@ -324,14 +322,8 @@ export const Home: React.FC = () => {
useEffect
(()
=>
{
useEffect
(()
=>
{
login
()
login
()
// 首页首次挂载时重置为通用模式:
// 1. 清除 Redux 中的 currentToolId
dispatch
(
clearCurrentToolId
())
dispatch
(
clearCurrentToolId
())
// 2. 清除 sessionStorage 中可能残留的 currentToolId,避免沿用上一次工具模式
},
[])
// 依赖数组为空,只在组件挂载时执行一次
// sessionStorage.removeItem('currentToolId')
// 3. 首页首次挂载时仅使用空 toolId 拉取常见问题
handleInitialQuestions
()
},
[
handleInitialQuestions
])
// 依赖数组为空,只在组件挂载时执行一次
return
(
return
(
<
div
className=
{
styles
.
homePage
}
>
<
div
className=
{
styles
.
homePage
}
>
...
...
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