ajax请求成功,接受不到响应数据,直接进error

var reqData = {
        tel:this.usertel,
        pwd:this.$md5(this.userpwd)
      };
      $.ajax({
        url: config.loginUrl,
        type: 'POST',
        async:false,
        data: JSON.stringify(reqData) ,
        // contentType: 'application/json',
        dataType: 'application/json',
        timeout: 5000,
        success: function (response) {
          console.log(response)
        },
        error: function () {
          console.log("#####error#####")
        }
      });

 

用postman测试接口是没问题的,返回了json对象,但是用这个Ajax调用,可以调用到对应的服务,但是拿不到返回的响应信息,直接走的error。求大神教我。前端response里面是failed to load response data.

服务端的代码:

@ResponseBody
    @RequestMapping(value = "/loginin", method = RequestMethod.POST)
    public Result loginIn (HttpServletRequest request) {
        JSONObject json = (JSONObject) request.getAttribute("json");
        User user = userService.loginIn(json);
        Result result;
        if(user == null){
            result = new Result("账号或密码错误", Result.failed);
        } else {
            user.setUserpwd("");
            result = new Result(user, Result.success);
        }
        return result;
    }

 

form表单的提交要使用这个   contentType:"application/x-www-form-urlencoded",

dataType: 'json',

//换成对象接收试试
public Result loginIn (@RequestBody User user) {

}