|
@@ -29,6 +29,7 @@ function getc(obj) {
|
|
|
}
|
|
|
|
|
|
router.beforeEach(async (to, from, next) => {
|
|
|
+
|
|
|
NProgress.start()
|
|
|
document.title = getPageTitle(to.meta.title)
|
|
|
const hasToken = getToken()
|
|
@@ -48,16 +49,31 @@ router.beforeEach(async (to, from, next) => {
|
|
|
global.antRouter = []
|
|
|
next()
|
|
|
}
|
|
|
+
|
|
|
+ var userInfo = JSON.parse(localStorage.getItem('greemall_user'))
|
|
|
+ var moduleObj = {
|
|
|
+ // 辅材配件
|
|
|
+ auxiliaryFittings: userInfo.moduleMaterialPart,
|
|
|
+ // 维保
|
|
|
+ engineeringMaintenance: userInfo.moduleWb,
|
|
|
+ // 延保
|
|
|
+ valueAddedService: userInfo.moduleYb,
|
|
|
+ }
|
|
|
+
|
|
|
// 设置路由
|
|
|
lay.children = []
|
|
|
for (var route of store.getters.menus) {
|
|
|
- lay.children.push(...buildRoute(route))
|
|
|
+ if (moduleObj[route.code] !== false) {
|
|
|
+ lay.children.push(...buildRoute(route))
|
|
|
+ }
|
|
|
}
|
|
|
lay.redirect = getc(lay).path
|
|
|
router.addRoutes([lay])
|
|
|
global.antRouter = []
|
|
|
for (var route of store.getters.menus) {
|
|
|
- global.antRouter.push(...buildRoute(route, '', false))
|
|
|
+ if (moduleObj[route.code] !== false) {
|
|
|
+ global.antRouter.push(...buildRoute(route, '', false))
|
|
|
+ }
|
|
|
}
|
|
|
next({
|
|
|
...to,
|