|
@@ -26,7 +26,7 @@ const router = new VueRouter({
|
|
|
* 路由守卫
|
|
* 路由守卫
|
|
|
*/
|
|
*/
|
|
|
router.beforeEach((to, from, next) => {
|
|
router.beforeEach((to, from, next) => {
|
|
|
- console.log(to,'to')
|
|
|
|
|
|
|
+ console.log(to, 'to');
|
|
|
|
|
|
|
|
if (!from.path.includes(REDIRECT_PATH)) {
|
|
if (!from.path.includes(REDIRECT_PATH)) {
|
|
|
NProgress.start();
|
|
NProgress.start();
|
|
@@ -99,8 +99,7 @@ router.afterEach((to) => {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
router.roleChange = async ({ menus, homePath, authoritiesRouter }) => {
|
|
router.roleChange = async ({ menus, homePath, authoritiesRouter }) => {
|
|
|
- const currentUser = getCurrentUser()
|
|
|
|
|
-
|
|
|
|
|
|
|
+ const currentUser = getCurrentUser();
|
|
|
|
|
|
|
|
if (menus && menus.length > 0) {
|
|
if (menus && menus.length > 0) {
|
|
|
router.addRoute(getMenuRoutes([...menus, ...authoritiesRouter], homePath));
|
|
router.addRoute(getMenuRoutes([...menus, ...authoritiesRouter], homePath));
|
|
@@ -127,7 +126,8 @@ router.roleChange = async ({ menus, homePath, authoritiesRouter }) => {
|
|
|
'vuex-main-data',
|
|
'vuex-main-data',
|
|
|
'vuex-wms',
|
|
'vuex-wms',
|
|
|
'vuex-qms',
|
|
'vuex-qms',
|
|
|
- 'vuex-vis'
|
|
|
|
|
|
|
+ 'vuex-vis',
|
|
|
|
|
+ 'vuex-cost'
|
|
|
].forEach((key) => {
|
|
].forEach((key) => {
|
|
|
sessionStorage.removeItem(key);
|
|
sessionStorage.removeItem(key);
|
|
|
});
|
|
});
|