hookehuyr

fix(api): 处理401错误时不显示错误信息

避免在401错误时显示错误信息,因为会自动跳转到登录页
...@@ -23,7 +23,10 @@ export const fn = (api) => { ...@@ -23,7 +23,10 @@ export const fn = (api) => {
23 } else { 23 } else {
24 // tslint:disable-next-line: no-console 24 // tslint:disable-next-line: no-console
25 // if (!res.data.show) return false; 25 // if (!res.data.show) return false;
26 - showFailToast(res.data.msg); 26 + // 如果是401错误,不显示错误信息,因为会自动跳转到登录页
27 + if (res.data.code !== 401) {
28 + showFailToast(res.data.msg);
29 + }
27 return false; 30 return false;
28 } 31 }
29 }) 32 })
......