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
Feb 17, 2023
by
杨思琦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 多用户菜单修复
parent
556890fa
Pipeline
#67657
passed with stages
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
14 deletions
+10
-14
reducer.js
src/containers/App/store/reducer.js
+7
-8
BasicLayout.js
src/layouts/BasicLayout.js
+3
-6
No files found.
src/containers/App/store/reducer.js
View file @
61c5715d
...
@@ -42,11 +42,10 @@ const proxy = require('../../../../config/proxy');
...
@@ -42,11 +42,10 @@ const proxy = require('../../../../config/proxy');
const
keywordStorage
=
new
Storage
(
`__global_search_keywords__micro_
${
window
.
location
.
hostname
}
`
);
const
keywordStorage
=
new
Storage
(
`__global_search_keywords__micro_
${
window
.
location
.
hostname
}
`
);
const
recentVisitedStorage
=
new
Storage
(
`__global_recent_visited__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
recentProductStorage
=
new
Storage
(
`__global__recent_product__micro_
${
window
.
location
.
hostname
}
`
);
const
currentProduct
=
new
Store
(
const
currentProduct
=
`__global__recent_productIndex__micro_
${
window
.
location
.
hostname
}
_
${
params
.
getParams
(
'client'
)
||
`__global__recent_productIndex__micro_
${
window
.
location
.
hostname
}
_
${
params
.
getParams
(
'client'
)
||
sessionStorage
.
getItem
(
'client'
)
||
sessionStorage
.
getItem
(
'client'
)
||
'city'
}
`
,
'city'
}
`
;
);
sessionStorage
.
setItem
(
currentProduct
,
0
);
Cookies
.
set
(
'loginMode'
,
Cookies
.
get
(
'loginMode'
)
||
'pdw'
);
Cookies
.
set
(
'loginMode'
,
Cookies
.
get
(
'loginMode'
)
||
'pdw'
);
export
const
initialState
=
fromJS
({
export
const
initialState
=
fromJS
({
globalConfig
:
{},
globalConfig
:
{},
...
@@ -59,7 +58,7 @@ export const initialState = fromJS({
...
@@ -59,7 +58,7 @@ export const initialState = fromJS({
recentKeywords
:
keywordStorage
.
list
||
[],
recentKeywords
:
keywordStorage
.
list
||
[],
recentVisited
:
recentVisitedStorage
.
list
||
[],
recentVisited
:
recentVisitedStorage
.
list
||
[],
recentProducts
:
recentProductStorage
.
list
||
[],
recentProducts
:
recentProductStorage
.
list
||
[],
currentMenuIndex
:
currentProduct
.
get
(
'currentMenuIndex'
)
||
0
,
currentMenuIndex
:
Number
(
sessionStorage
.
getItem
(
currentProduct
)
)
||
0
,
currentMenu
:
null
,
currentMenu
:
null
,
collapsed
:
true
,
collapsed
:
true
,
loginMode
:
Cookies
.
get
(
'loginMode'
)
||
'pdw'
,
loginMode
:
Cookies
.
get
(
'loginMode'
)
||
'pdw'
,
...
@@ -149,7 +148,7 @@ const appReducer = (state = initialState, action) => {
...
@@ -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
;
const
parent
=
home
.
level
>=
2
?
home
.
parent
.
parent
:
home
.
level
>=
3
?
home
.
parent
.
parent
.
parent
:
home
.
parent
;
if
(
parent
)
{
if
(
parent
)
{
currentMenuIndex
=
generMenu
.
findIndex
(
item
=>
item
.
name
===
parent
.
label
);
currentMenuIndex
=
generMenu
.
findIndex
(
item
=>
item
.
name
===
parent
.
label
);
currentProduct
.
set
(
'currentMenuIndex'
,
currentMenuIndex
);
sessionStorage
.
setItem
(
currentProduct
,
currentMenuIndex
)
store
.
set
(
'updateMenuIndex'
,
currentMenuIndex
);
store
.
set
(
'updateMenuIndex'
,
currentMenuIndex
);
}
}
}
}
...
@@ -205,9 +204,9 @@ const appReducer = (state = initialState, action) => {
...
@@ -205,9 +204,9 @@ const appReducer = (state = initialState, action) => {
recentVisited
:
[],
recentVisited
:
[],
});
});
case
GET_CURRENT_INDEX
:
case
GET_CURRENT_INDEX
:
currentProduct
.
set
(
'currentMenuIndex'
,
action
.
data
);
sessionStorage
.
setItem
(
currentProduct
,
action
.
data
)
return
state
.
merge
({
return
state
.
merge
({
currentMenuIndex
:
currentProduct
.
get
(
'currentMenuIndex'
),
currentMenuIndex
:
Number
(
sessionStorage
.
getItem
(
currentProduct
)
),
});
});
case
SLIDER_MENU_MODE
:
case
SLIDER_MENU_MODE
:
return
state
.
merge
({
return
state
.
merge
({
...
...
src/layouts/BasicLayout.js
View file @
61c5715d
...
@@ -19,7 +19,6 @@ import { useHistory, useLocation } from '@wisdom-utils/runtime';
...
@@ -19,7 +19,6 @@ import { useHistory, useLocation } from '@wisdom-utils/runtime';
import
{
helpers
,
store
,
event
}
from
'@wisdom-utils/utils'
;
import
{
helpers
,
store
,
event
}
from
'@wisdom-utils/utils'
;
import
{
Storeage
as
Store
}
from
'@wisdom-utils/utils/lib/helpers'
;
import
{
Storeage
as
Store
}
from
'@wisdom-utils/utils/lib/helpers'
;
import
Loading
from
'../components/Loading'
;
import
Loading
from
'../components/Loading'
;
import
{
waterMark
}
from
'../utils/mark'
;
import
{
waterMark
}
from
'../utils/mark'
;
import
layoutStyles
from
'./BasicLayout.less'
;
import
layoutStyles
from
'./BasicLayout.less'
;
import
SecurityLayout
from
'./SecurityLayout'
;
import
SecurityLayout
from
'./SecurityLayout'
;
...
@@ -245,11 +244,9 @@ const transformFloatMenu = (routes, homepage) => {
...
@@ -245,11 +244,9 @@ const transformFloatMenu = (routes, homepage) => {
};
};
const
Layout
=
props
=>
{
const
Layout
=
props
=>
{
const
currentProduct
=
new
Store
(
const
currentProduct
=
`__global__recent_productIndex__micro_
${
window
.
location
.
hostname
}
_
${
params
.
getParams
(
'client'
)
||
`__global__recent_productIndex__micro_
${
window
.
location
.
hostname
}
_
${
params
.
getParams
(
'client'
)
||
sessionStorage
.
getItem
(
'client'
)
||
sessionStorage
.
getItem
(
'client'
)
||
'city'
}
`
,
'city'
}
`
;
);
const
menuState
=
sessionStorage
.
getItem
(
'menuState'
)
||
'open'
;
const
menuState
=
sessionStorage
.
getItem
(
'menuState'
)
||
'open'
;
const
[
cityData
,
setCityData
]
=
useState
({});
const
[
cityData
,
setCityData
]
=
useState
({});
const
[
siteLoading
,
setSiteLoading
]
=
useState
(
false
);
const
[
siteLoading
,
setSiteLoading
]
=
useState
(
false
);
...
@@ -419,7 +416,7 @@ const Layout = props => {
...
@@ -419,7 +416,7 @@ const Layout = props => {
// onLoadingChange: (loading) => setMenuLoading(loading)
// onLoadingChange: (loading) => setMenuLoading(loading)
}}
}}
logo
=
{
logo
}
logo
=
{
logo
}
topMenuActiveKey
=
{
currentProduct
.
get
(
'currentMenuIndex'
)
||
0
}
topMenuActiveKey
=
{
Number
(
sessionStorage
.
getItem
(
currentProduct
)
)
||
0
}
rightContentRender
=
{()
=>
<
RightContent
/>
}
rightContentRender
=
{()
=>
<
RightContent
/>
}
onPageChange
=
{()
=>
{
onPageChange
=
{()
=>
{
// if(!props.global.token) {
// if(!props.global.token) {
...
...
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