Commit 3524897c authored by zhangyanni's avatar zhangyanni

用户轨迹

parent cb0b41a0
......@@ -460,6 +460,38 @@ export default {
}
},
fetchNoCancelLoadingPost(url, params, method = 'POST') {
var langVal = url.indexOf('?') == -1 ? '?lang=' + lang : '&lang=' + lang, _this = this;
return new Promise((resolve, reject) => {
axios({
method: method,
url: base + url + langVal + "&t=" + Date.parse(new Date()),
data: params,
headers: {
accessToken: publicFun.getCookie(publicFun.judgeBrand() + "userInfo") ? JSON.parse(require('js-base64').Base64.decode(publicFun.getCookie(publicFun.judgeBrand() + "userInfo"))).accessToken : '',
deviceId: publicFun.getCookie("getGuid32"),
clientCode: clientCode,
'Content-Security-Policy': "script-src 'self'; object-src 'none'; style-src cdn.example.org third-party.org;"
},
}, {
// 单独配置
withCredentials: true
}).then((response) => {
if (response.headers.loginstatus == 2) {
publicFun.removeCookie("userInfo");
}
_this.getCodeFunc(response.data.code, resolve, response)
}).catch((error) => {
if (axios.isCancel(error)) {
console.log('Rquest canceled', error.message);
//请求如果被取消,这里是返回取消的message
} else {
reject(error)
}
})
})
},
//导出
fetchLoadingPostex(url, params, method = 'POST') {
var langVal = url.indexOf('?') == -1 ? '?lang=' + lang : '&lang=' + lang, _this = this;
......
......@@ -241,6 +241,6 @@ export default {
//获取用户浏览轨迹
getUserTrajectory(params){
return api.fetchLogin("/business/log/viewLog",params);
return api.fetchNoCancelLoadingPost("/business/log/viewLog",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