Commit 3895ddce by Liu

feat:区分用户中心与策略中心

parent d397d34e
...@@ -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
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment