mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-06-22 03:42:42 +08:00
fixed: token过期返回401
This commit is contained in:
parent
786dd8d78a
commit
094de41a4f
@ -26,11 +26,11 @@ import java.util.List;
|
||||
@Slf4j
|
||||
public class ExceptionController {
|
||||
|
||||
// @ExceptionHandler(Exception.class)
|
||||
// public JsonResponse exceptionHandler(Exception e) {
|
||||
// log.error(e.getMessage());
|
||||
// return JsonResponse.error("系统错误", 500);
|
||||
// }
|
||||
@ExceptionHandler(Exception.class)
|
||||
public JsonResponse exceptionHandler(Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return JsonResponse.error("系统错误", 500);
|
||||
}
|
||||
|
||||
@ExceptionHandler(ServiceException.class)
|
||||
public JsonResponse serviceExceptionHandler(ServiceException e) {
|
||||
|
@ -61,7 +61,7 @@ public class FrontMiddleware implements HandlerInterceptor {
|
||||
|
||||
User user = userService.find(payload.getSub());
|
||||
if (user == null) {
|
||||
return responseTransform(response, 404, "请重新登录");
|
||||
return responseTransform(response, 401, "请重新登录");
|
||||
}
|
||||
if (user.getIsLock() == 1) {
|
||||
return responseTransform(response, 403, "当前学员已锁定无法登录");
|
||||
|
Loading…
x
Reference in New Issue
Block a user