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
3895ddce
Commit
3895ddce
authored
Dec 15, 2025
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:区分用户中心与策略中心
parent
d397d34e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
src/routes/RouteChangeHandler.tsx
+13
-0
No files found.
src/routes/RouteChangeHandler.tsx
View file @
3895ddce
...
@@ -22,9 +22,21 @@ export function withRouteChangeHandler(WrappedComponent: React.ComponentType) {
...
@@ -22,9 +22,21 @@ export function withRouteChangeHandler(WrappedComponent: React.ComponentType) {
if
(
location
.
pathname
===
'/home'
)
{
if
(
location
.
pathname
===
'/home'
)
{
const
searchParams
=
new
URLSearchParams
(
location
.
search
)
const
searchParams
=
new
URLSearchParams
(
location
.
search
)
const
from
=
searchParams
.
get
(
'from'
)
const
from
=
searchParams
.
get
(
'from'
)
// 获取place参数值
const
place
=
searchParams
.
get
(
'place'
)
if
(
from
===
'tactics'
)
{
if
(
from
===
'tactics'
)
{
// 在重定向前缓存查询参数,供 /tactics 页读取(避免 from 被清理导致丢失)
// 在重定向前缓存查询参数,供 /tactics 页读取(避免 from 被清理导致丢失)
try
{
try
{
if
(
place
)
{
const
userMeta
=
{
cstId
:
searchParams
.
get
(
'cstId'
)
||
undefined
,
userId
:
searchParams
.
get
(
'userId'
)
||
undefined
,
numberType
:
searchParams
.
get
(
'numberType'
)
||
undefined
,
place
,
}
sessionStorage
.
setItem
(
'userMeta'
,
JSON
.
stringify
(
userMeta
))
}
else
{
const
meta
=
{
const
meta
=
{
version
:
searchParams
.
get
(
'version'
)
||
undefined
,
version
:
searchParams
.
get
(
'version'
)
||
undefined
,
taskId
:
searchParams
.
get
(
'taskId'
)
||
undefined
,
taskId
:
searchParams
.
get
(
'taskId'
)
||
undefined
,
...
@@ -37,6 +49,7 @@ export function withRouteChangeHandler(WrappedComponent: React.ComponentType) {
...
@@ -37,6 +49,7 @@ export function withRouteChangeHandler(WrappedComponent: React.ComponentType) {
}
}
sessionStorage
.
setItem
(
'tacticsMeta'
,
JSON
.
stringify
(
meta
))
sessionStorage
.
setItem
(
'tacticsMeta'
,
JSON
.
stringify
(
meta
))
}
}
}
catch
{
catch
{
// ignore
// ignore
}
}
...
...
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