[feat][M]: 新增用户权限校验出错Exception

master
Romesum 5 years ago
parent 76980e6f91
commit e48b3dc752

@ -18,4 +18,10 @@ public class GlobalExceptionHandler {
public ResultVO handlerAuthorizeException(HttpServletRequest servletRequest,Exception e) {
return ResultVOUtil.error(401,e.getMessage());
}
@ExceptionHandler(value = UserRuleAuthorizeException.class)
@ResponseBody
public ResultVO handlerRuleAuthorizeException(HttpServletRequest servletRequest,Exception e) {
return ResultVOUtil.error(403,e.getMessage());
}
}

@ -0,0 +1,13 @@
package com.hzu.bookingsystem.exception;
/**
* author
*/
public class UserRuleAuthorizeException extends RuntimeException {
public UserRuleAuthorizeException(){
}
public UserRuleAuthorizeException(String message){
super(message);
}
}
Loading…
Cancel
Save