修改request

This commit is contained in:
TOP糯米 2023-03-11 15:38:58 +08:00
parent 4d204a5b97
commit 8fd627b98f
1 changed files with 6 additions and 1 deletions

View File

@ -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);