pref: 网络异常的情况下需提示网络异常而不是系统出错
This commit is contained in:
parent
16af625aef
commit
4cd4550a36
8
resources/assets/js/store/actions.js
vendored
8
resources/assets/js/store/actions.js
vendored
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user