From 241e29f7056a328fc980dc9f6e22ae1bd57c8c06 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期日, 04 八月 2024 20:36:50 +0800
Subject: [PATCH] Merge pull request #1557 from ZhaoYandong00/patch-3
---
src/main/java/com/genersoft/iot/vmp/conf/security/JwtAuthenticationFilter.java | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/conf/security/JwtAuthenticationFilter.java b/src/main/java/com/genersoft/iot/vmp/conf/security/JwtAuthenticationFilter.java
index 274a19f..ebeea98 100644
--- a/src/main/java/com/genersoft/iot/vmp/conf/security/JwtAuthenticationFilter.java
+++ b/src/main/java/com/genersoft/iot/vmp/conf/security/JwtAuthenticationFilter.java
@@ -35,10 +35,15 @@
// 蹇界暐鐧诲綍璇锋眰鐨則oken楠岃瘉
String requestURI = request.getRequestURI();
+ if ((requestURI.startsWith("/doc.html") || requestURI.startsWith("/swagger-ui") ) && !userSetting.getDocEnable()) {
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ return;
+ }
if (requestURI.equalsIgnoreCase("/api/user/login")) {
chain.doFilter(request, response);
return;
}
+
if (!userSetting.isInterfaceAuthentication()) {
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(null, null, new ArrayList<>() );
SecurityContextHolder.getContext().setAuthentication(token);
--
Gitblit v1.8.0