| | |
| | | import Logo from './Logo' |
| | | import SidebarItem from './SidebarItem' |
| | | import variables from '@/styles/variables.scss' |
| | | var isMock = require('@/config/baseConfig').isMock // 全局配置文件 |
| | | |
| | | export default { |
| | | components: { SidebarItem, Logo }, |
| | |
| | | ]), |
| | | 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) { |
| | | // mock模式 全显示 |
| | | if (isMock) return true |
| | | // 不存在权限的话,默认显示 |
| | | // console.log(menu.auth, menu.auth ? !!authData[menu.auth] : true) |
| | | // 忽视hidden=true |
| | |
| | | if (menu.children.length) { |
| | | // 递归 |
| | | menu.children = this.jun_filterAuth(menu.children, authData) |
| | | // mock模式 全显示 |
| | | if (isMock) return true |
| | | return menu.children.length |
| | | } |
| | | }) |