修复全局异常类bug

This commit is contained in:
TinyAnts 2022-08-12 12:13:54 +08:00
parent e0fde0cf0f
commit 2038901e2d
1 changed files with 12 additions and 0 deletions

View File

@ -38,6 +38,18 @@ public class GlobalException {
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
*/