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, } },