| | |
| | | ]), |
| | | routes() { |
| | | let routes = this.$router.options.routes |
| | | routes = this.jun_filterAuth(routes, this.getAuthDataFN()) |
| | | routes = this.jun_filterAuth(routes, () => {}) |
| | | // routes = this.jun_filterAuth(routes, this.getAuthDataFN()) |
| | | // console.log('this.getAuthDataFN()', this.getAuthDataFN()) |
| | | // console.log('$router.options.routes', this.$router.options.routes) |
| | | // console.log('routes', routes) |
| | |
| | | return menuData.filter((menu) => { |
| | | // 仅有一级菜单 |
| | | if (!menu.children) { |
| | | // isMock=1 全显示 |
| | | // mock模式 全显示 |
| | | if (isMock) return true |
| | | // 不存在权限的话,默认显示 |
| | | // console.log(menu.auth, menu.auth ? !!authData[menu.auth] : true) |
| | |
| | | if (menu.children.length) { |
| | | // 递归 |
| | | menu.children = this.jun_filterAuth(menu.children, authData) |
| | | // isMock=1 全显示 |
| | | // mock模式 全显示 |
| | | if (isMock) return true |
| | | return menu.children.length |
| | | } |