Commit 28766d5c authored by IvyXia123's avatar IvyXia123

cookie

parent 9dbed645
......@@ -11,4 +11,4 @@
position: fixed;
background: #f4f4f4;
}
/* html{font-size: 1px;} */</style><link href=static/css/app.ed6d1273dc8c2d144766934b011e5890.css rel=stylesheet></head><body><div id=app></div><script src=https://res.wx.qq.com/open/js/jweixin-1.3.2.js></script><script></script><script type=text/javascript src=static/js/manifest.73b4e03dd1137dd81f8b.js></script><script type=text/javascript src=static/js/vendor.0c1d6ebbba685002d59c.js></script><script type=text/javascript src=static/js/app.9d1398a59d3230f33440.js></script></body></html>
\ No newline at end of file
/* html{font-size: 1px;} */</style><link href=static/css/app.ed6d1273dc8c2d144766934b011e5890.css rel=stylesheet></head><body><div id=app></div><script src=https://res.wx.qq.com/open/js/jweixin-1.3.2.js></script><script></script><script type=text/javascript src=static/js/manifest.73b4e03dd1137dd81f8b.js></script><script type=text/javascript src=static/js/vendor.0c1d6ebbba685002d59c.js></script><script type=text/javascript src=static/js/app.8bf13f62b5ba2865ec24.js></script></body></html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -17,35 +17,18 @@ axios.interceptors.request.use(
// 获取token
// process.env.versionTime
let versiontime = '09021400';
// alert(window.navigator.userAgent.split('=')[1]);
// const token = window.navigator.userAgent.split('=')[1] ? 'Bearer ' + window.navigator.userAgent.split('=')[1] : localStorage.getItem('cc_token');
const token = common.getUrlParam().token || localStorage.getItem('cc_token');
const token = window.navigator.userAgent.split('=')[1] ? 'Bearer ' + window.navigator.userAgent.split('=')[1] : localStorage.getItem('cc_token');
alert(token)
// 设置参数格式
if (!config.headers['Content-Type']) {
config.headers = {
"Content-Type": "application/json;charset=utf-8"
};
}
/* if(token) {
console.log(99999)
config.headers = {
'cookie': 'base_api_session'
};
}*/
// 添加token到headers
if (token) {
// config.headers.token = token
config.headers = {
"token": token,
}
document.cookie = 'base_api_session=' + token.split(' ')[1]
config.headers.token = token
}
/*if(window.navigator.userAgent.split('=')[1]) {
config.headers.Cookie = 'base_api_session' + window.navigator.userAgent.split('=')[1]
}*/
// 鉴权参数设置
if (config.method === 'get' && config.url !== '/api/admin/login') {
config.params = config.params || {};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment