mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-06-22 11:52:43 +08:00
fixed: token过期返回401
This commit is contained in:
parent
786dd8d78a
commit
094de41a4f
@ -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) {
|
||||||
|
@ -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, "当前学员已锁定无法登录");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user