Commit 1e75e5ec authored by IvyXia123's avatar IvyXia123

eee

parent 0afd8ff6
...@@ -11,4 +11,4 @@ ...@@ -11,4 +11,4 @@
position: fixed; position: fixed;
background: #f4f4f4; 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.362e448c8b929b31c3dd.js></script></body></html> /* 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.ef9aea30fd997ed112bf.js></script></body></html>
\ No newline at end of file \ No newline at end of file
This diff is collapsed.
This diff is collapsed.
...@@ -7,6 +7,7 @@ import common from '../util/common' ...@@ -7,6 +7,7 @@ import common from '../util/common'
import Cookie from '../util/cookie' import Cookie from '../util/cookie'
// 默认超时设置 // 默认超时设置
axios.defaults.timeout = 50000; axios.defaults.timeout = 50000;
axios.defaults.withCredentials = true; //让ajax携带cookie
// 相对路径设置 // 相对路径设置
axios.defaults.baseURL = ''; axios.defaults.baseURL = '';
...@@ -21,21 +22,27 @@ axios.interceptors.request.use( ...@@ -21,21 +22,27 @@ axios.interceptors.request.use(
// const token = window.navigator.userAgent.split('=')[1] ? 'Bearer ' + window.navigator.userAgent.split('=')[1] : localStorage.getItem('cc_token'); // 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 = common.getUrlParam().token || localStorage.getItem('cc_token');
alert(token)
// 设置参数格式 // 设置参数格式
if (!config.headers['Content-Type']) { if (!config.headers['Content-Type']) {
config.headers = { config.headers = {
'Content-Type': 'application/json', "Content-Type": "application/json;charset=utf-8"
'cookie': 'base_api_session'
}; };
} }
if(token) { /* if(token) {
config.headers.cookie = 'base_api_session' console.log(99999)
} config.headers = {
'cookie': 'base_api_session'
};
}*/
// 添加token到headers // 添加token到headers
if (token) { if (token) {
console.log(777777) console.log(777777)
config.headers.token = token // config.headers.token = token
config.headers = {
"token": token,
}
document.cookie = 'base_api_session=3454363456345645'
} }
/*if(window.navigator.userAgent.split('=')[1]) { /*if(window.navigator.userAgent.split('=')[1]) {
...@@ -185,8 +192,7 @@ export function upload(url, json) { ...@@ -185,8 +192,7 @@ export function upload(url, json) {
export function fetch(url, params = {}) { export function fetch(url, params = {}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.get(url, { axios.get(url, {
params: params, params: params
headers: { token: common.getParamByName('token'), platform: 'web' }
}) })
.then(response => { .then(response => {
// if(url == process.env.API_URL+'api/client/user/bind/chance'||url == process.env.API_URL+'api/client/me'){ // if(url == process.env.API_URL+'api/client/user/bind/chance'||url == process.env.API_URL+'api/client/me'){
......
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