Authored by 王涛

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

@@ -268,8 +268,16 @@ layui.define(['sessions', 'form', 'common'],function (exports) { @@ -268,8 +268,16 @@ layui.define(['sessions', 'form', 'common'],function (exports) {
268 }, 268 },
269 error: function (xhr) { 269 error: function (xhr) {
270 layer.closeAll('loading'); 270 layer.closeAll('loading');
271 - var error =JSON.parse(xhr.responseText) ;  
272 - var error_msg = error.error_description ? error.error_description :error.resp_msg ; 271 + var error ;
  272 + var error_msg;
  273 + try {
  274 + error =JSON.parse(xhr.responseText) ;
  275 + error_msg = error.error_description ? error.error_description :error.resp_msg ;
  276 + } catch (e){
  277 + error = {
  278 + status:500
  279 + }
  280 + }
273 if (xhr.status == 500){ 281 if (xhr.status == 500){
274 error_msg = "服务器异常"; 282 error_msg = "服务器异常";
275 }else if (xhr.status == 0){ 283 }else if (xhr.status == 0){