fixed: token过期返回401

This commit is contained in:
none 2023-04-07 11:41:08 +08:00
parent 786dd8d78a
commit 094de41a4f
2 changed files with 6 additions and 6 deletions

View File

@ -26,11 +26,11 @@ import java.util.List;
@Slf4j @Slf4j
public class ExceptionController { public class ExceptionController {
// @ExceptionHandler(Exception.class) @ExceptionHandler(Exception.class)
// public JsonResponse exceptionHandler(Exception e) { public JsonResponse exceptionHandler(Exception e) {
// log.error(e.getMessage()); log.error(e.getMessage());
// return JsonResponse.error("系统错误", 500); return JsonResponse.error("系统错误", 500);
// } }
@ExceptionHandler(ServiceException.class) @ExceptionHandler(ServiceException.class)
public JsonResponse serviceExceptionHandler(ServiceException e) { public JsonResponse serviceExceptionHandler(ServiceException e) {

View File

@ -61,7 +61,7 @@ public class FrontMiddleware implements HandlerInterceptor {
User user = userService.find(payload.getSub()); User user = userService.find(payload.getSub());
if (user == null) { if (user == null) {
return responseTransform(response, 404, "请重新登录"); return responseTransform(response, 401, "请重新登录");
} }
if (user.getIsLock() == 1) { if (user.getIsLock() == 1) {
return responseTransform(response, 403, "当前学员已锁定无法登录"); return responseTransform(response, 403, "当前学员已锁定无法登录");