Commit dad5e236 by xiexiaoqin

fix: fetch 401 relogin

parent 8a2bda89
...@@ -24,11 +24,13 @@ export default function xFetch({ url, method, data, type }) { ...@@ -24,11 +24,13 @@ export default function xFetch({ url, method, data, type }) {
if (res.data.code == 401) { if (res.data.code == 401) {
login(); login();
} }
alertOnce('请求异常,请重试', rejects); alertOnce(res.data.msg || '请求异常,请重试', rejects);
} }
}, },
fail: function (err) { fail: function (err) {
console.log(err) if (err && err.status == 401) {
login();
}
alertOnce('网络异常,请重试', rejects); alertOnce('网络异常,请重试', rejects);
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment