This commit is contained in:
starrySky
2024-08-15 14:43:08 +08:00
parent 80c6a151da
commit d878892154

View File

@@ -33,7 +33,7 @@ public class GlobalExceptionHandler {
*/ */
@ExceptionHandler(ServiceException.class) @ExceptionHandler(ServiceException.class)
public R handleServiceException(ServiceException e, HttpServletRequest request) { public R handleServiceException(ServiceException e, HttpServletRequest request) {
if ("token异常".equals(e.getMessage())) { if ("token异常".equals(e.getMessage()) || "token为空".equals(e.getMessage())) {
log.error("用户token异常"); log.error("用户token异常");
} else { } else {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
@@ -109,7 +109,7 @@ public class GlobalExceptionHandler {
*/ */
@ExceptionHandler(CustomException.class) @ExceptionHandler(CustomException.class)
public R customException(CustomException e) { public R customException(CustomException e) {
if ("token异常".equals(e.getMessage())) { if ("token异常".equals(e.getMessage()) || "token为空".equals(e.getMessage())) {
log.error("用户token异常"); log.error("用户token异常");
} else { } else {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);