nili 1 week ago
parent
commit
f7cf104602
  1. 4
      game-web/src/main/java/awesome/group/game/web/filter/AdminLoginFilter.java

4
game-web/src/main/java/awesome/group/game/web/filter/AdminLoginFilter.java

@ -55,6 +55,7 @@ public class AdminLoginFilter implements Filter {
"/api/admin/swagger/v3/api-docs" "/api/admin/swagger/v3/api-docs"
); );
boolean pass = false; boolean pass = false;
boolean inOpenApi = false;
Integer adminId = null; Integer adminId = null;
try { try {
if (StringUtils.hasText(token)) { if (StringUtils.hasText(token)) {
@ -70,11 +71,12 @@ public class AdminLoginFilter implements Filter {
for (String s : openApi) { for (String s : openApi) {
if (path.startsWith(s)) { if (path.startsWith(s)) {
pass = true; pass = true;
inOpenApi = true;
} }
} }
if (pass) { if (pass) {
RequestContext.initAdmin(httpRequest, (HttpServletResponse) response, adminId); RequestContext.initAdmin(httpRequest, (HttpServletResponse) response, adminId);
if (adminId != null) { if (adminId != null && !inOpenApi) {
MatrixAdmin admin = adminMapper.selectById(adminId); MatrixAdmin admin = adminMapper.selectById(adminId);
if (admin != null && admin.getDisable() > 0) { if (admin != null && admin.getDisable() > 0) {
channelDisable(response); channelDisable(response);

Loading…
Cancel
Save