uniapp-提交订单时取消订单,提示错误
uniapp-购物车编辑数量后未更新数量统计 uniapp-token失效未进行重新登录 uniapp-查看物流-点标识太大 造成部分物流信息被遮挡
This commit is contained in:
@ -10,10 +10,12 @@ fly.config.baseURL = VUE_APP_API_URL
|
||||
|
||||
fly.interceptors.response.use(
|
||||
response => {
|
||||
console.log(response)
|
||||
// 定时刷新access-token
|
||||
return response;
|
||||
},
|
||||
error => {
|
||||
console.log(error)
|
||||
if (error.toString() == 'Error: Network Error') {
|
||||
toLogin();
|
||||
return Promise.reject({ msg: "未登录", toLogin: true });
|
||||
@ -47,18 +49,15 @@ function baseRequest(options) {
|
||||
// 提示错误信息
|
||||
return Promise.reject({ msg: "未登录", toLogin: true });
|
||||
}
|
||||
console.log(options)
|
||||
// 结构请求需要的参数
|
||||
const { url, params, data, login, ...option } = options
|
||||
|
||||
// 发起请求
|
||||
return fly.request(url, params || data, {
|
||||
...option
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
}).then(res => {
|
||||
const data = res.data || {};
|
||||
if (res.status !== 200) {
|
||||
|
||||
return Promise.reject({ msg: "请求失败", res, data });
|
||||
}
|
||||
if ([410000, 410001, 410002].indexOf(data.status) !== -1) {
|
||||
|
Reference in New Issue
Block a user