|
|
@ -32,7 +32,23 @@ service.interceptors.response.use( |
|
|
|
return Promise.reject(error.response) |
|
|
|
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')
|
|
|
|
// let token = sessionStorage.getItem('token')
|
|
|
|
export function get(url, params = {}) { |
|
|
|
export function get(url, params = {}) { |
|
|
|
// params.t = new Date().getTime(); //get方法加一个时间参数,解决ie下可能缓存问题.
|
|
|
|
// params.t = new Date().getTime(); //get方法加一个时间参数,解决ie下可能缓存问题.
|
|
|
|