Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-3
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
office
haoban-3
Commits
b1a069ca
Commit
b1a069ca
authored
May 13, 2022
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 切换商户后页面无权访问就回首页
parent
23214280
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
App.vue
src/App.vue
+9
-1
change-store.vue
src/components/layout/components/change-store.vue
+4
-1
index.vue
src/components/layout/index.vue
+0
-2
No files found.
src/App.vue
View file @
b1a069ca
...
...
@@ -114,7 +114,15 @@ export default {
const
menu
=
rightList
.
find
(
el
=>
el
.
menuUrl
==
toPath
.
substr
(
1
));
// 页面第一次打开后,校验权限的beforeEach还没有创建,所以需要手动校验一下页面权限
if
(
menu
&&
menu
.
hasRight
==
0
)
{
this
.
$router
.
push
({
path
:
'/403'
});
// 切换商户后,如果当前页面无访问权限,就回首页
// 如果地址栏中输入无权访问的路径,就到403
const
hbReloadPath
=
sessionStorage
.
getItem
(
'hbReloadPath'
)
||
''
;
if
(
menu
.
menuUrl
==
hbReloadPath
.
substr
(
1
))
{
this
.
$router
.
push
(
'/index'
);
sessionStorage
.
removeItem
(
'hbReloadPath'
);
}
else
{
this
.
$router
.
push
({
path
:
'/403'
});
}
}
consoleButtonCode
(
menu
);
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
...
...
src/components/layout/components/change-store.vue
View file @
b1a069ca
...
...
@@ -90,7 +90,10 @@ export default {
}
this
.
isExpired
=
result
;
if
(
!
result
)
{
location
.
reload
();
sessionStorage
.
setItem
(
'hbReloadPath'
,
this
.
$route
.
path
);
setTimeout
(()
=>
{
location
.
reload
();
},
100
);
}
})
.
finally
(()
=>
this
.
$emit
(
'changeStore'
,
false
));
...
...
src/components/layout/index.vue
View file @
b1a069ca
...
...
@@ -67,8 +67,6 @@ export default {
provideData
.
layoutVm
=
this
;
this
.
enterpriseId
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'userInfos'
)
||
'{}'
).
enterpriseId
;
this
.
$on
(
'command'
,
this
.
onCommand
);
// this.flatMenuList = this.getFlatMenuList(this.menuList);
// this.activedMenu = this.getActivedMenu(this.getMenuByPath(this.$route.path.slice(1)));
this
.
getEnterpriseSecret
();
},
methods
:
{
...
...
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