|
@@ -52,19 +52,20 @@ router.beforeEach((to, from, next) => {
|
|
|
next({ path: '/login' })
|
|
|
} else {
|
|
|
if (!addRouFlag) {
|
|
|
- addRouFlag = true
|
|
|
if(user != null) {
|
|
|
+ addRouFlag = true
|
|
|
+ console.log()
|
|
|
if(user.role == 0) {
|
|
|
var getRoutes = baseRoleGetRouters(staffRouter, 1);
|
|
|
global.antRouter = fixedRouter.concat(getRoutes);
|
|
|
- router.options.routes = fixedRouter.concat(getRoutes);
|
|
|
router.addRoutes(fixedRouter.concat(getRoutes));
|
|
|
+ router.options.routes = fixedRouter.concat(getRoutes);
|
|
|
router.push({ path: to.path })
|
|
|
} else {
|
|
|
var getRoutes = baseRoleGetRouters(manageRouter, 1);
|
|
|
global.antRouter = fixedRouter.concat(getRoutes);
|
|
|
- router.options.routes = fixedRouter.concat(getRoutes);
|
|
|
router.addRoutes(fixedRouter.concat(getRoutes));
|
|
|
+ router.options.routes = fixedRouter.concat(getRoutes);
|
|
|
router.push({ path: to.path })
|
|
|
}
|
|
|
}
|