refactor: bc 方法增加ajax请求错误时显示地址

This commit is contained in:
Argo Zhang 2019-07-26 15:20:54 +08:00
parent 21c8080a1f
commit 59cd001c74
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
1 changed files with 4 additions and 1 deletions

View File

@ -200,7 +200,10 @@
success(result); success(result);
}, },
error: function (XMLHttpRequest, textStatus, errorThrown) { error: function (XMLHttpRequest, textStatus, errorThrown) {
if (window.toastr) toastr.error(XMLHttpRequest.status === 500 ? '后台应用程序错误' : errorThrown, '程序错误'); if (window.toastr) {
if (errorThrown === '') errorThrown = url;
toastr.error(XMLHttpRequest.status === 500 ? '后台应用程序错误' : errorThrown, '程序错误');
}
success(false); success(false);
} }
}; };