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
9112f406
Commit
9112f406
authored
Dec 22, 2025
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:常见问题接口重复调用
parent
b4204fda
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
18 deletions
+2
-18
src/pages/Home/HomeNew.tsx
+2
-18
No files found.
src/pages/Home/HomeNew.tsx
View file @
9112f406
...
...
@@ -120,13 +120,6 @@ export const Home: React.FC = () => {
setIsDataLoaded
(
false
)
// 重置加载状态
try
{
const
storedToolId
=
safeSessionStorageGetItem
(
'currentToolId'
)
||
''
// eslint-disable-next-line no-console
console
.
log
(
'20251211 _handleToolClick before calc'
,
{
isToolBtn
,
toolId
,
ignoreUrlToolId
,
storedToolId
,
})
// 首页初始化加载常见问题时,允许忽略路由中的 toolId,避免带入上一次的工具 ID
const
shouldForceClearToolId
=
!
storedToolId
...
...
@@ -147,13 +140,6 @@ export const Home: React.FC = () => {
// 调用真实 API 获取常见问题列表,优先使用 sessionStorage 中的 currentToolId
const
sessionToolId
=
safeSessionStorageGetItem
(
'currentToolId'
)
||
''
// 调试:记录最终用于请求的 toolId
// 20251211 调试:记录最终用于请求的 toolId
// eslint-disable-next-line no-console
console
.
log
(
'20251211 _handleToolClick fetch'
,
{
sessionToolId
,
finalToolId
,
})
const
res
=
await
fetchEfficiencyQuestionList
({
toolId
:
sessionToolId
||
finalToolId
,
})
...
...
@@ -246,7 +232,7 @@ export const Home: React.FC = () => {
window
.
dispatchEvent
(
new
CustomEvent
(
'forceResetToGeneralMode'
))
initConversation
()
dispatch
(
fetchConversations
())
// 2. 拉取常见问题等业务数据
// 2. 拉取常见问题等业务数据
_handleToolClick
(
false
,
''
,
true
)
}
}
...
...
@@ -301,10 +287,8 @@ export const Home: React.FC = () => {
// 只有登录成功(拿到 token)后才拉业务接口
if
(
!
token
)
return
// 首页首次挂载时重置为制度活化:
// 1. 清除 Redux 中的 currentToolId
dispatch
(
clearCurrentToolId
())
},
[
token
,
dispatch
,
_handleToolClick
])
},
[
token
,
dispatch
])
return
(
<
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