|
|
@ -52,20 +52,12 @@ Vue.prototype.NumberMul = function(arg1, arg2) { |
|
|
|
router.beforeEach((to, from, next) => { |
|
|
|
router.beforeEach((to, from, next) => { |
|
|
|
document.title = config.title; |
|
|
|
document.title = config.title; |
|
|
|
const role = sessionStorage.getItem('kd_client_username'); |
|
|
|
const role = sessionStorage.getItem('kd_client_username'); |
|
|
|
if (!role && to.path !== '/login') { |
|
|
|
if (!role && to.path !== '/login' && to.path !== '/clientLogin') { |
|
|
|
next('/login') |
|
|
|
next('/clientLogin') |
|
|
|
// if(to.fullPath != '/404' && to.fullPath != '/'){
|
|
|
|
|
|
|
|
// next({
|
|
|
|
|
|
|
|
// path: '/login',
|
|
|
|
|
|
|
|
// query: {redirect: to.fullPath}
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// }else{
|
|
|
|
|
|
|
|
// next('/login')
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
} else if (to.meta.permission) { |
|
|
|
} else if (to.meta.permission) { |
|
|
|
// 如果是管理员权限则可进入,这里只是简单的模拟管理员权限而已
|
|
|
|
// 如果是管理员权限则可进入,这里只是简单的模拟管理员权限而已
|
|
|
|
role === 'admin' ? next() : next('/403'); |
|
|
|
role === 'admin' ? next() : next('/403'); |
|
|
|
} else if(role && to.path == '/login') { |
|
|
|
} else if(role && to.path == '/clientLogin') { |
|
|
|
next('/dashboard') |
|
|
|
next('/dashboard') |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// 简单的判断IE10及以下不进入富文本编000000000000辑器,该组件不兼容
|
|
|
|
// 简单的判断IE10及以下不进入富文本编000000000000辑器,该组件不兼容
|
|
|
|