修复全局异常类bug
This commit is contained in:
parent
e0fde0cf0f
commit
2038901e2d
|
|
@ -38,6 +38,18 @@ public class GlobalException {
|
||||||
return AjaxResult.failed(HttpEnum.SYSTEM_ERROR.getCode(), HttpEnum.SYSTEM_ERROR.getMsg());
|
return AjaxResult.failed(HttpEnum.SYSTEM_ERROR.getCode(), HttpEnum.SYSTEM_ERROR.getMsg());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拦截自定义抛出异常
|
||||||
|
*/
|
||||||
|
@ResponseStatus(HttpStatus.OK)
|
||||||
|
@ExceptionHandler(BaseException.class)
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult handleException(BaseException e) {
|
||||||
|
int code = e.getCode();
|
||||||
|
String msg = e.getMsg();
|
||||||
|
return AjaxResult.failed(code, msg);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拦截表单参数校验FROM
|
* 拦截表单参数校验FROM
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue