pref: 网络异常的情况下需提示网络异常而不是系统出错

This commit is contained in:
kuaifan 2022-03-03 14:53:01 +08:00
parent 16af625aef
commit 4cd4550a36

View File

@ -74,8 +74,12 @@ export default {
}
}
};
params.error = () => {
reject({data: {}, msg: "System error"})
params.error = (xhr, status) => {
if (window.navigator.onLine === false || (status === 0 && xhr.readyState === 4)) {
reject({data: {}, msg: $A.L('网络异常,请稍后再试!')})
} else {
reject({data: {}, msg: "System error"})
}
};
//
if (params.websocket === true || params.ws === true) {