Commit 9b831a9 1 parent 46a4403 commit 9b831a9 Copy full SHA for 9b831a9
File tree 3 files changed +8
-4
lines changed
java/com/app/login/config
3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 20
20
21
21
22
22
/**
23
- * Updated SecurityConfiguration for Spring Boot 2.7+
23
+ * Updated SecurityConfiguration for Spring Boot 3
24
24
* @author Megadotnet
25
25
* @date 2024-03-07
26
26
*/
@@ -65,7 +65,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
65
65
.requestMatchers ("/api/authenticate" ).permitAll ()
66
66
.requestMatchers ("/api/account/reset_password/init" ).permitAll ()
67
67
.requestMatchers ("/api/account/reset_password/finish" ).permitAll ()
68
- .requestMatchers ("/app/**/*.{js,html} " ).permitAll ()
68
+ .requestMatchers ("/app/**" ).permitAll ()
69
69
.requestMatchers ("/bower_components/**" ).permitAll ()
70
70
.requestMatchers ("/i18n/**" ).permitAll ()
71
71
.requestMatchers ("/content/**" ).permitAll ()
@@ -75,7 +75,9 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
75
75
.requestMatchers (HttpMethod .OPTIONS , "/**" ).permitAll ()
76
76
.requestMatchers ("/v3/api-docs/**" ).permitAll () // Swagger API 文档
77
77
.requestMatchers ("/swagger-ui.html" ).permitAll () // Swagger UI 页面
78
- .requestMatchers ("/swagger-ui/**" ).permitAll ()) // Swagger UI 相关资源
78
+ .requestMatchers ("/swagger-ui/**" ).permitAll () // Swagger UI 相关资源
79
+ .requestMatchers ("/static/**" ).permitAll () // 静态文件
80
+ .requestMatchers ("/**" ).permitAll ())
79
81
.apply (new JWTConfigurer (tokenProvider ));
80
82
81
83
return http .build ();
Original file line number Diff line number Diff line change 15
15
import jakarta .servlet .ServletContext ;
16
16
import jakarta .servlet .ServletException ;
17
17
import jakarta .servlet .ServletRegistration ;
18
+ import org .springframework .web .servlet .config .annotation .ResourceHandlerRegistry ;
19
+
18
20
import java .io .File ;
19
21
import java .nio .file .Paths ;
20
22
import java .util .EnumSet ;
@@ -44,6 +46,7 @@ public void onStartup(ServletContext servletContext) throws ServletException {
44
46
log .info ("Web application fully configured" );
45
47
}
46
48
49
+
47
50
/**
48
51
* Resolve path prefix to static resources.
49
52
*/
Original file line number Diff line number Diff line change 3
3
xsi:schemaLocation ="http://www.thymeleaf.org ">
4
4
< head >
5
5
< meta http-equiv ="Content-Type " content ="text/html; charset=UTF-8 "/>
6
- < link rel ="shortcut icon " href ="${baseUrl}/favicon.ico " />
7
6
< title > Your request cannot be processed</ title >
8
7
< style >
9
8
::-moz-selection {
You can’t perform that action at this time.
0 commit comments