qq_李白的酒卍无味_0
2019-04-27 16:18
@ExceptionHandler(Exception.class)
@ResponseStatus(HttpStatus.OK)
@ResponseBody
public Object handlerException(HttpServletRequest repuest,Exception ex){
BusinessException businessException = (BusinessException) ex;
CommonReyurnType type = new CommonReyurnType();
/* Map<String, Object> map = new HashMap<>();
map.put("errcode", businessException.getErrCode());
map.put("errmsg", businessException.getErrMsg());*/
type.setStatus("fail");
type.setData(ex);
return type;
}
UserServiceImpl.java的改成這樣就行了
UserDo userDo = userDoMapper.selectByPrimaryKey(id); if(userDo==null){ return null; } UserPasswordDo userPasswordDo = userPasswordDoMapper.selectByUserId(userDo.getId()); if (userPasswordDo==null){ return null; } return convertFromDataobject(userDo,userPasswordDo);}
我也是这个问题
同样问题
解决问题了么?
同样这个问题
传参的时候没传ex,你看看ex是不是null
SpringBoot构建电商基础秒杀项目
49065 学习 · 954 问题
相似问题