Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mobi
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
1
Merge Requests
1
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
wbx-PCAndMobi
mobi
Commits
97a2a4cc
Commit
97a2a4cc
authored
Apr 29, 2021
by
程卓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注释冗余sidemenu代码(路由被权限码接管)
parent
c45cd5ba
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
63 deletions
+63
-63
sidemenu.vue
src/components/Layout/sidemenu.vue
+63
-63
No files found.
src/components/Layout/sidemenu.vue
View file @
97a2a4cc
...
...
@@ -56,70 +56,70 @@ export default {
},
},
mounted
(){
this
.
$ajax
.
get
({
url
:
this
.
$api
.
GET_USER_INFO
,
}).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
isAllPerm
=
res
.
data
.
content
.
isAllPerm
console
.
log
(
this
.
isAllPerm
)
let
menus
=
[]
let
tempmenu
=
[]
let
isLoadExtendMenu
=
this
.
$cookie
.
get
(
'customKeyEnable'
)
for
(
let
i
=
0
;
i
<
routes
.
length
;
i
++
){
if
(
!!
routes
[
i
].
children
){
for
(
let
j
=
0
;
j
<
routes
[
i
].
children
.
length
;
j
++
){
if
(
!!
this
.
isAllPerm
)
{
// 超管访问
if
(
!!
routes
[
i
].
children
[
j
].
meta
.
menuIcon
&&
routes
[
i
].
children
[
j
].
name
==
'systemManagement'
&&
isLoadExtendMenu
==
'false'
){
let
target
=
routes
[
i
].
children
[
j
].
children
if
(
target
.
length
>
0
)
{
for
(
let
k
=
0
;
k
<
target
.
length
;
k
++
)
{
if
(
target
[
k
].
name
==
'tbls'
)
{
if
(
isLoadExtendMenu
==
'true'
)
{
tempmenu
.
push
(
target
[
k
])
}
}
else
{
tempmenu
.
push
(
target
[
k
])
}
}
}
let
lusso
=
routes
[
i
].
children
[
j
]
lusso
.
children
=
[]
lusso
.
children
=
tempmenu
menus
.
push
(
lusso
)
}
else
if
(
!!
routes
[
i
].
children
[
j
].
meta
.
menuIcon
)
{
menus
.
push
(
routes
[
i
].
children
[
j
])
}
//
this.$ajax.get({
//
url: this.$api.GET_USER_INFO,
//
}).then(res => {
//
if(res.code == 200) {
//
this.isAllPerm = res.data.content.isAllPerm
//
console.log(this.isAllPerm)
//
let menus=[]
//
let tempmenu = []
//
let isLoadExtendMenu = this.$cookie.get('customKeyEnable')
//
for(let i=0;i
<
routes
.
length
;
i
++
){
//
if(!!routes[i].children){
//
for(let j=0;j
<
routes
[
i
].
children
.
length
;
j
++
){
//
if(!!this.isAllPerm) { // 超管访问
//
if(!!routes[i].children[j].meta.menuIcon && routes[i].children[j].name == 'systemManagement' && isLoadExtendMenu == 'false'){
//
let target = routes[i].children[j].children
//
if(target.length > 0) {
//
for(let k = 0 ; k
<
target
.
length
;
k
++
)
{
//
if(target[k].name == 'tbls') {
//
if(isLoadExtendMenu == 'true') {
//
tempmenu.push(target[k])
//
}
//
} else {
//
tempmenu.push(target[k])
//
}
//
}
//
}
//
let lusso = routes[i].children[j]
//
lusso.children = []
//
lusso.children = tempmenu
//
menus.push(lusso)
//
} else if (!!routes[i].children[j].meta.menuIcon) {
//
menus.push(routes[i].children[j])
//
}
}
else
if
(
!
this
.
isAllPerm
)
{
// 非超管访问
if
(
routes
[
i
].
children
[
j
].
meta
.
isAllPerm
==
false
)
{
if
(
!!
routes
[
i
].
children
[
j
].
meta
.
menuIcon
&&
routes
[
i
].
children
[
j
].
name
==
'systemManagement'
&&
isLoadExtendMenu
==
'false'
){
let
target
=
routes
[
i
].
children
[
j
].
children
if
(
target
.
length
>
0
)
{
for
(
let
k
=
0
;
k
<
target
.
length
;
k
++
)
{
if
(
target
[
k
].
name
==
'tbls'
)
{
if
(
isLoadExtendMenu
==
'true'
)
{
tempmenu
.
push
(
target
[
k
])
}
}
else
{
tempmenu
.
push
(
target
[
k
])
}
}
}
let
lusso
=
routes
[
i
].
children
[
j
]
lusso
.
children
=
[]
lusso
.
children
=
tempmenu
menus
.
push
(
lusso
)
}
else
if
(
!!
routes
[
i
].
children
[
j
].
meta
.
menuIcon
)
{
menus
.
push
(
routes
[
i
].
children
[
j
])
}
}
}
}
}
}
this
.
menus
=
menus
}
})
//
} else if(!this.isAllPerm) { // 非超管访问
//
if(routes[i].children[j].meta.isAllPerm == false) {
//
if(!!routes[i].children[j].meta.menuIcon && routes[i].children[j].name == 'systemManagement' && isLoadExtendMenu == 'false'){
//
let target = routes[i].children[j].children
//
if(target.length > 0) {
//
for(let k = 0 ; k
<
target
.
length
;
k
++
)
{
//
if(target[k].name == 'tbls') {
//
if(isLoadExtendMenu == 'true') {
//
tempmenu.push(target[k])
//
}
//
} else {
//
tempmenu.push(target[k])
//
}
//
}
//
}
//
let lusso = routes[i].children[j]
//
lusso.children = []
//
lusso.children = tempmenu
//
menus.push(lusso)
//
} else if (!!routes[i].children[j].meta.menuIcon) {
//
menus.push(routes[i].children[j])
//
}
//
}
//
}
//
}
//
}
//
}
//
this.menus=menus
//
}
//
})
},
computed
:
{
menus
(){
...
...
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