修改request
This commit is contained in:
parent
4d204a5b97
commit
8fd627b98f
|
@ -53,10 +53,15 @@ const request = async (args) => {
|
|||
|
||||
(rule.showLoading) && uni.hideLoading();
|
||||
|
||||
if (error) {
|
||||
prototype.$utils.toast('网络错误');
|
||||
throw "网络错误";
|
||||
}
|
||||
|
||||
if (response.data.code == 10001) {
|
||||
$store.dispatch("user/logout");
|
||||
$store.commit("user/showLoginModal", true);
|
||||
return;
|
||||
throw "登录态失效";
|
||||
}
|
||||
|
||||
return Promise.resolve(response.data);
|
||||
|
|
Loading…
Reference in New Issue