From cd218d1e8835d2378529bd0701cb44ab9b10ea7a Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Thu, 27 May 2021 11:25:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=93=E5=AE=B6=E9=80=9A=E9=81=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/page/Login.vue | 2 +- src/main.js | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/components/page/Login.vue b/src/components/page/Login.vue index 8f744f6..3cc5ee6 100644 --- a/src/components/page/Login.vue +++ b/src/components/page/Login.vue @@ -52,7 +52,7 @@ export default { }, methods:{ toClient(){ - location.href = location.host.includes('116.63.168.79') ? 'http://116.63.168.79/kdclient/#/login' : 'http://122.9.154.146/kdclient/#/login' + location.href = location.host.includes('116.63.168.79') ? 'http://116.63.168.79/kdclient/#/login' : 'http://122.9.154.146/kdclient/#/clientLogin' }, toMang(){ location.href = location.host.includes('116.63.168.79') ? 'http://116.63.168.79/kdserver/#/login' : 'http://122.9.154.146/kdserver/#/login' diff --git a/src/main.js b/src/main.js index 22cda38..b48185c 100644 --- a/src/main.js +++ b/src/main.js @@ -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辑器,该组件不兼容