Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivWeb
Commits
61c5715d
Commit
61c5715d
authored
2 years ago
by
杨思琦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 多用户菜单修复
parent
556890fa
Pipeline
#67657
passed with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
16 deletions
+12
-16
reducer.js
src/containers/App/store/reducer.js
+8
-9
BasicLayout.js
src/layouts/BasicLayout.js
+4
-7
No files found.
src/containers/App/store/reducer.js
View file @
61c5715d
...
...
@@ -42,11 +42,10 @@ const proxy = require('../../../../config/proxy');
const
keywordStorage
=
new
Storage
(
`__global_search_keywords__micro_
${
window
.
location
.
hostname
}
`
);
const
recentVisitedStorage
=
new
Storage
(
`__global_recent_visited__micro_
${
window
.
location
.
hostname
}
`
);
const
recentProductStorage
=
new
Storage
(
`__global__recent_product__micro_
${
window
.
location
.
hostname
}
`
);
const
currentProduct
=
new
Store
(
`__global__recent_productIndex__micro_
${
window
.
location
.
hostname
}
_
${
params
.
getParams
(
'client'
)
||
sessionStorage
.
getItem
(
'client'
)
||
'city'
}
`
,
);
const
currentProduct
=
`__global__recent_productIndex__micro_
${
window
.
location
.
hostname
}
_
${
params
.
getParams
(
'client'
)
||
sessionStorage
.
getItem
(
'client'
)
||
'city'
}
`
;
sessionStorage
.
setItem
(
currentProduct
,
0
);
Cookies
.
set
(
'loginMode'
,
Cookies
.
get
(
'loginMode'
)
||
'pdw'
);
export
const
initialState
=
fromJS
({
globalConfig
:
{},
...
...
@@ -59,7 +58,7 @@ export const initialState = fromJS({
recentKeywords
:
keywordStorage
.
list
||
[],
recentVisited
:
recentVisitedStorage
.
list
||
[],
recentProducts
:
recentProductStorage
.
list
||
[],
currentMenuIndex
:
currentProduct
.
get
(
'currentMenuIndex'
)
||
0
,
currentMenuIndex
:
Number
(
sessionStorage
.
getItem
(
currentProduct
)
)
||
0
,
currentMenu
:
null
,
collapsed
:
true
,
loginMode
:
Cookies
.
get
(
'loginMode'
)
||
'pdw'
,
...
...
@@ -149,7 +148,7 @@ const appReducer = (state = initialState, action) => {
const
parent
=
home
.
level
>=
2
?
home
.
parent
.
parent
:
home
.
level
>=
3
?
home
.
parent
.
parent
.
parent
:
home
.
parent
;
if
(
parent
)
{
currentMenuIndex
=
generMenu
.
findIndex
(
item
=>
item
.
name
===
parent
.
label
);
currentProduct
.
set
(
'currentMenuIndex'
,
currentMenuIndex
);
sessionStorage
.
setItem
(
currentProduct
,
currentMenuIndex
)
store
.
set
(
'updateMenuIndex'
,
currentMenuIndex
);
}
}
...
...
@@ -205,9 +204,9 @@ const appReducer = (state = initialState, action) => {
recentVisited
:
[],
});
case
GET_CURRENT_INDEX
:
currentProduct
.
set
(
'currentMenuIndex'
,
action
.
data
);
sessionStorage
.
setItem
(
currentProduct
,
action
.
data
)
return
state
.
merge
({
currentMenuIndex
:
currentProduct
.
get
(
'currentMenuIndex'
),
currentMenuIndex
:
Number
(
sessionStorage
.
getItem
(
currentProduct
)
),
});
case
SLIDER_MENU_MODE
:
return
state
.
merge
({
...
...
This diff is collapsed.
Click to expand it.
src/layouts/BasicLayout.js
View file @
61c5715d
...
...
@@ -19,7 +19,6 @@ import { useHistory, useLocation } from '@wisdom-utils/runtime';
import
{
helpers
,
store
,
event
}
from
'@wisdom-utils/utils'
;
import
{
Storeage
as
Store
}
from
'@wisdom-utils/utils/lib/helpers'
;
import
Loading
from
'../components/Loading'
;
import
{
waterMark
}
from
'../utils/mark'
;
import
layoutStyles
from
'./BasicLayout.less'
;
import
SecurityLayout
from
'./SecurityLayout'
;
...
...
@@ -245,11 +244,9 @@ const transformFloatMenu = (routes, homepage) => {
};
const
Layout
=
props
=>
{
const
currentProduct
=
new
Store
(
`__global__recent_productIndex__micro_
${
window
.
location
.
hostname
}
_
${
params
.
getParams
(
'client'
)
||
sessionStorage
.
getItem
(
'client'
)
||
'city'
}
`
,
);
const
currentProduct
=
`__global__recent_productIndex__micro_
${
window
.
location
.
hostname
}
_
${
params
.
getParams
(
'client'
)
||
sessionStorage
.
getItem
(
'client'
)
||
'city'
}
`
;
const
menuState
=
sessionStorage
.
getItem
(
'menuState'
)
||
'open'
;
const
[
cityData
,
setCityData
]
=
useState
({});
const
[
siteLoading
,
setSiteLoading
]
=
useState
(
false
);
...
...
@@ -419,7 +416,7 @@ const Layout = props => {
// onLoadingChange: (loading) => setMenuLoading(loading)
}}
logo
=
{
logo
}
topMenuActiveKey
=
{
currentProduct
.
get
(
'currentMenuIndex'
)
||
0
}
topMenuActiveKey
=
{
Number
(
sessionStorage
.
getItem
(
currentProduct
)
)
||
0
}
rightContentRender
=
{()
=>
<
RightContent
/>
}
onPageChange
=
{()
=>
{
// if(!props.global.token) {
...
...
This diff is collapsed.
Click to expand it.
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