From 326bed7eeb0f59ed2e6269436401efad67dfc90f Mon Sep 17 00:00:00 2001 From: e <2432808546@qq.com> Date: Mon, 22 Nov 2021 11:20:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=8F=90=E4=BA=A4=E5=90=8E?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=95=B0=E6=8D=AEbug=20=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E9=A1=B5=E9=9D=A2=E8=8E=B7=E5=8F=96=E4=B8=8D?= =?UTF-8?q?=E5=88=B0token=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/api.js | 18 +++++++++++++++++- src/components/case/index.vue | 4 ++-- src/pages/index/list/index.vue | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/api/api.js b/src/api/api.js index ccda07c..1c321e1 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -32,7 +32,23 @@ service.interceptors.response.use( return Promise.reject(error.response) } ) -let token = sessionStorage.getItem('token') +let tokens +let token +var reg = new RegExp('(^|&)'+'token'+'=([^&]*)(&|$)') +if(window.location.href.split('?')[1]){ + var r = window.location.href.split('?')[1].match(reg) + if (r != null){ + tokens = (r[2]) + }else{ + tokens = null + } +} +if(tokens){ + token = tokens +}else{ + token = sessionStorage.getItem('token') +} +console.log(token) // let token = sessionStorage.getItem('token') export function get(url, params = {}) { // params.t = new Date().getTime(); //get方法加一个时间参数,解决ie下可能缓存问题. diff --git a/src/components/case/index.vue b/src/components/case/index.vue index f81bd09..15a7df1 100644 --- a/src/components/case/index.vue +++ b/src/components/case/index.vue @@ -64,7 +64,7 @@ - + @@ -183,7 +183,7 @@ export default { projectName:'', loading:false, sss:1, - popContainer:false + popContainer:false, } }, watch: { diff --git a/src/pages/index/list/index.vue b/src/pages/index/list/index.vue index cd7c4bc..587d108 100644 --- a/src/pages/index/list/index.vue +++ b/src/pages/index/list/index.vue @@ -32,7 +32,7 @@ export default { return { caseVisible: true, comingVisible: false, - timer: null + timer: null, } },