Authored by 王涛

优化登录返回错误结果为空js错误

... ... @@ -268,8 +268,16 @@ layui.define(['sessions', 'form', 'common'],function (exports) {
},
error: function (xhr) {
layer.closeAll('loading');
var error =JSON.parse(xhr.responseText) ;
var error_msg = error.error_description ? error.error_description :error.resp_msg ;
var error ;
var error_msg;
try {
error =JSON.parse(xhr.responseText) ;
error_msg = error.error_description ? error.error_description :error.resp_msg ;
} catch (e){
error = {
status:500
}
}
if (xhr.status == 500){
error_msg = "服务器异常";
}else if (xhr.status == 0){
... ...