部门管理

This commit is contained in:
none
2023-02-19 12:15:57 +08:00
parent 166dc4c1a2
commit 9c97b774a0
15 changed files with 514 additions and 6 deletions

View File

@@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;
import xyz.playedu.api.PlayEduThreadLocal;
import xyz.playedu.api.bus.AppBus;
import xyz.playedu.api.bus.BackendBus;
import xyz.playedu.api.constant.SystemConstant;
import xyz.playedu.api.domain.AdminUser;
@@ -29,6 +30,9 @@ public class AdminAuthMiddleware implements HandlerInterceptor {
@Autowired
private AdminUserService adminUserService;
@Autowired
private AppBus appBus;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
if (BackendBus.inUnAuthWhitelist(request.getRequestURI())) {
@@ -56,6 +60,9 @@ public class AdminAuthMiddleware implements HandlerInterceptor {
return HandlerInterceptor.super.preHandle(request, response, handler);
} catch (Exception e) {
if (appBus.isDev()) {
log.debug("jwt解析失败:" + e.getMessage());
}
responseTransform(response, 401, "请重新登录");
return false;
}