Commit 97a2a4cc authored by 程卓's avatar 程卓

注释冗余sidemenu代码(路由被权限码接管)

parent c45cd5ba
...@@ -56,70 +56,70 @@ export default { ...@@ -56,70 +56,70 @@ export default {
}, },
}, },
mounted(){ mounted(){
this.$ajax.get({ // this.$ajax.get({
url: this.$api.GET_USER_INFO, // url: this.$api.GET_USER_INFO,
}).then(res => { // }).then(res => {
if(res.code == 200) { // if(res.code == 200) {
this.isAllPerm = res.data.content.isAllPerm // this.isAllPerm = res.data.content.isAllPerm
console.log(this.isAllPerm) // console.log(this.isAllPerm)
let menus=[] // let menus=[]
let tempmenu = [] // let tempmenu = []
let isLoadExtendMenu = this.$cookie.get('customKeyEnable') // let isLoadExtendMenu = this.$cookie.get('customKeyEnable')
for(let i=0;i<routes.length;i++){ // for(let i=0;i<routes.length;i++){
if(!!routes[i].children){ // if(!!routes[i].children){
for(let j=0;j<routes[i].children.length;j++){ // for(let j=0;j<routes[i].children.length;j++){
if(!!this.isAllPerm) { // 超管访问 // if(!!this.isAllPerm) { // 超管访问
if(!!routes[i].children[j].meta.menuIcon && routes[i].children[j].name == 'systemManagement' && isLoadExtendMenu == 'false'){ // if(!!routes[i].children[j].meta.menuIcon && routes[i].children[j].name == 'systemManagement' && isLoadExtendMenu == 'false'){
let target = routes[i].children[j].children // let target = routes[i].children[j].children
if(target.length > 0) { // if(target.length > 0) {
for(let k = 0 ; k < target.length; k++) { // for(let k = 0 ; k < target.length; k++) {
if(target[k].name == 'tbls') { // if(target[k].name == 'tbls') {
if(isLoadExtendMenu == 'true') { // if(isLoadExtendMenu == 'true') {
tempmenu.push(target[k]) // tempmenu.push(target[k])
} // }
} else { // } else {
tempmenu.push(target[k]) // tempmenu.push(target[k])
} // }
} // }
} // }
let lusso = routes[i].children[j] // let lusso = routes[i].children[j]
lusso.children = [] // lusso.children = []
lusso.children = tempmenu // lusso.children = tempmenu
menus.push(lusso) // menus.push(lusso)
} else if (!!routes[i].children[j].meta.menuIcon) { // } else if (!!routes[i].children[j].meta.menuIcon) {
menus.push(routes[i].children[j]) // menus.push(routes[i].children[j])
} // }
} else if(!this.isAllPerm) { // 非超管访问 // } else if(!this.isAllPerm) { // 非超管访问
if(routes[i].children[j].meta.isAllPerm == false) { // if(routes[i].children[j].meta.isAllPerm == false) {
if(!!routes[i].children[j].meta.menuIcon && routes[i].children[j].name == 'systemManagement' && isLoadExtendMenu == 'false'){ // if(!!routes[i].children[j].meta.menuIcon && routes[i].children[j].name == 'systemManagement' && isLoadExtendMenu == 'false'){
let target = routes[i].children[j].children // let target = routes[i].children[j].children
if(target.length > 0) { // if(target.length > 0) {
for(let k = 0 ; k < target.length; k++) { // for(let k = 0 ; k < target.length; k++) {
if(target[k].name == 'tbls') { // if(target[k].name == 'tbls') {
if(isLoadExtendMenu == 'true') { // if(isLoadExtendMenu == 'true') {
tempmenu.push(target[k]) // tempmenu.push(target[k])
} // }
} else { // } else {
tempmenu.push(target[k]) // tempmenu.push(target[k])
} // }
} // }
} // }
let lusso = routes[i].children[j] // let lusso = routes[i].children[j]
lusso.children = [] // lusso.children = []
lusso.children = tempmenu // lusso.children = tempmenu
menus.push(lusso) // menus.push(lusso)
} else if (!!routes[i].children[j].meta.menuIcon) { // } else if (!!routes[i].children[j].meta.menuIcon) {
menus.push(routes[i].children[j]) // menus.push(routes[i].children[j])
} // }
} // }
} // }
} // }
} // }
} // }
this.menus=menus // this.menus=menus
} // }
}) // })
}, },
computed: { computed: {
menus(){ menus(){
......
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