From ba8c55059a0afd40c88bd95076f95d16b75d678b Mon Sep 17 00:00:00 2001 From: kanade Date: Thu, 20 Apr 2023 17:22:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=A2=E6=88=B7=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/permission.js | 11 +++++++++++ src/views/crm/components/RelativeContacts.vue | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/src/permission.js b/src/permission.js index 211d0fd..4912cb7 100644 --- a/src/permission.js +++ b/src/permission.js @@ -11,12 +11,23 @@ import { let loadAsyncRouter = false const whiteList = ['/login', '/welcome'] // 不重定向白名单 +// 获取参数 +function getUrlKey(name, url) { + // eslint-disable-next-line no-sparse-arrays + return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(url) || [, ''])[1].replace(/\+/g, '%20')) || null +} router.beforeEach((to, from, next) => { if (to.meta.disabled) { next(false) return } NProgress.start() + if (!getAuth() && window.location.href.indexOf('authkey') >= 0) { + store.commit('SET_AUTH', { + authKey: getUrlKey('authkey', window.location.href), + sessionId: getUrlKey('sessionid', window.location.href) + }) + } /** 请求头包含授权信息 并且 页面必须授权 直接进入 */ if (getAuth()) { if (whiteList.includes(to.path)) { diff --git a/src/views/crm/components/RelativeContacts.vue b/src/views/crm/components/RelativeContacts.vue index 46c3631..42481af 100644 --- a/src/views/crm/components/RelativeContacts.vue +++ b/src/views/crm/components/RelativeContacts.vue @@ -67,6 +67,10 @@ :prop="item.prop" :label="item.label" show-overflow-tooltip /> + -- 2.36.3