Feat(页面):监听页面打开次数和页面停留时长接口对接
This commit is contained in:
+16
-9
@@ -18,13 +18,18 @@ fly.interceptors.response.use(
|
||||
console.log('————————')
|
||||
handleLoginFailure();
|
||||
return Promise.reject({msg: "未登录", toLogin: true});
|
||||
}
|
||||
if (error.status == 401) {
|
||||
} else if (error.status == 401) {
|
||||
console.log('————————')
|
||||
console.log('登录失效 401', error)
|
||||
console.log('————————')
|
||||
handleLoginFailure();
|
||||
return Promise.reject({msg: "未登录", toLogin: true});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '服务开小差了,请稍后再试',
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
return Promise.reject(error);
|
||||
}
|
||||
@@ -61,13 +66,15 @@ function baseRequest(options) {
|
||||
} else if (data.status === 200) {
|
||||
return Promise.resolve(data, res);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.data.msg,
|
||||
icon: 'none',
|
||||
duration: 3000,
|
||||
success() {
|
||||
}
|
||||
})
|
||||
if (url.indexOf('api/systemStats/push') < 0) {
|
||||
uni.showToast({
|
||||
title: res.data.msg,
|
||||
icon: 'none',
|
||||
duration: 3000,
|
||||
success() {
|
||||
}
|
||||
})
|
||||
}
|
||||
return Promise.reject({msg: res.data.msg, res, data});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user