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
e015bccc
Commit
e015bccc
authored
Dec 03, 2025
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:sso_login成功后sessionStorage中存入toolId空值,空值默认高亮
parent
94303ad3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
src/components/ChatEditor/index.tsx
+4
-2
src/pages/Home/HomeNew.tsx
+1
-0
No files found.
src/components/ChatEditor/index.tsx
View file @
e015bccc
...
...
@@ -150,7 +150,8 @@ const ChatEditorBase: React.FC<ChatEditorProps & WithAuthProps> = ({ checkAuth,
useEffect
(()
=>
{
const
syncSessionToolId
=
()
=>
{
const
storedToolId
=
sessionStorage
.
getItem
(
'currentToolId'
)
setSessionToolId
(
storedToolId
)
// 如果 currentToolId 是空字符串,视为 null,确保通用模式能正确高亮
setSessionToolId
(
storedToolId
&&
storedToolId
.
trim
()
?
storedToolId
:
null
)
}
syncSessionToolId
()
window
.
addEventListener
(
'storage'
,
syncSessionToolId
)
...
...
@@ -162,7 +163,8 @@ const ChatEditorBase: React.FC<ChatEditorProps & WithAuthProps> = ({ checkAuth,
// 当路由变化时,同步更新 sessionToolId(因为 storage 事件不会在同标签页触发)
useEffect
(()
=>
{
const
storedToolId
=
sessionStorage
.
getItem
(
'currentToolId'
)
setSessionToolId
(
storedToolId
)
// 如果 currentToolId 是空字符串,视为 null,确保通用模式能正确高亮
setSessionToolId
(
storedToolId
&&
storedToolId
.
trim
()
?
storedToolId
:
null
)
},
[
toolIdFromUrl
])
const
startAnimation
=
()
=>
{
...
...
src/pages/Home/HomeNew.tsx
View file @
e015bccc
...
...
@@ -171,6 +171,7 @@ export const Home: React.FC = () => {
storageArea
:
localStorage
,
}),
)
sessionStorage
.
setItem
(
'currentToolId'
,
''
)
initConversation
()
dispatch
(
fetchConversations
())
}
...
...
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