优化异常返回编号

v1.4.1
Parker 4 years ago
parent 5a4188673f
commit 9870bec03a

@ -82,9 +82,9 @@ public class GlobalExceptionHandler {
*
*/
@ExceptionHandler(ServiceException.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@ResponseStatus(HttpStatus.OK)
@ResponseBody
public ResultVo<?> bussinessException(ServiceException e) {
public ResultVo<?> businessException(ServiceException e) {
log.warn("业务异常 - 异常编号:{} - 异常信息:{}",e.getCode(),e.getMessage());
return ResultVo.error(e.getCode(), e.getMessage());
}
@ -93,7 +93,7 @@ public class GlobalExceptionHandler {
*
*/
@ExceptionHandler(EmptyException.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@ResponseStatus(HttpStatus.OK)
@ResponseBody
public ResultVo<?> emptyException(EmptyException e) {
return ResultVo.error(e.getCode(), e.getMessage());
@ -103,7 +103,7 @@ public class GlobalExceptionHandler {
* Jwt
*/
@ExceptionHandler(JwtException.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@ResponseStatus(HttpStatus.OK)
@ResponseBody
public ResultVo<?> jwtException(JwtException e) {
return ResultVo.error(e.getCode(), e.getMessage());
@ -124,7 +124,7 @@ public class GlobalExceptionHandler {
* Shiro
*/
@ExceptionHandler(LockedAccountException.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@ResponseStatus(HttpStatus.OK)
@ResponseBody
public ResultVo<?> lockedAccountException(LockedAccountException e) {
// 账号已被锁定,请联系管理员
@ -135,7 +135,7 @@ public class GlobalExceptionHandler {
* Shiro
*/
@ExceptionHandler(AuthorizationException.class)
@ResponseStatus(HttpStatus.NOT_ACCEPTABLE)
@ResponseStatus(HttpStatus.OK)
@ResponseBody
public ResultVo<?> authorizationException(AuthorizationException e) {
// 无权访问该方法
@ -148,7 +148,7 @@ public class GlobalExceptionHandler {
* Shiro
*/
@ExceptionHandler(UnsupportedTokenException.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@ResponseStatus(HttpStatus.OK)
@ResponseBody
public ResultVo<?> unsupportedTokenException(UnsupportedTokenException e) {
// 找不到认证授权器
@ -162,7 +162,7 @@ public class GlobalExceptionHandler {
* Token
*/
@ExceptionHandler(TokenException.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@ResponseStatus(HttpStatus.OK)
@ResponseBody
public ResultVo<?> tokenException(TokenException e) {
// Token 异常

Loading…
Cancel
Save