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