mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-05-29 22:17:50 +08:00
fix: 新增api前缀
This commit is contained in:
@@ -161,7 +161,7 @@
|
|||||||
</executions>
|
</executions>
|
||||||
<configuration>
|
<configuration>
|
||||||
<!-- 此处为硬编码,应优化为 env 的配置 -->
|
<!-- 此处为硬编码,应优化为 env 的配置 -->
|
||||||
<apiDocsUrl>http://localhost:8080/v3/api-docs</apiDocsUrl>
|
<apiDocsUrl>http://localhost:8080/api/v3/api-docs</apiDocsUrl>
|
||||||
<outputFileName>openapi.json</outputFileName>
|
<outputFileName>openapi.json</outputFileName>
|
||||||
<outputDir>${project.build.directory}</outputDir>
|
<outputDir>${project.build.directory}</outputDir>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ public class SecurityConfig {
|
|||||||
.authorizeHttpRequests(auth -> auth
|
.authorizeHttpRequests(auth -> auth
|
||||||
.requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
|
.requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
|
||||||
.requestMatchers("/api/ws/**", "/api/sockjs/**").permitAll()
|
.requestMatchers("/api/ws/**", "/api/sockjs/**").permitAll()
|
||||||
.requestMatchers("/v3/api-docs/**").permitAll()
|
.requestMatchers("/api/v3/api-docs/**").permitAll()
|
||||||
.requestMatchers(HttpMethod.POST, "/api/auth/**").permitAll()
|
.requestMatchers(HttpMethod.POST, "/api/auth/**").permitAll()
|
||||||
.requestMatchers(HttpMethod.GET, "/api/posts/**").permitAll()
|
.requestMatchers(HttpMethod.GET, "/api/posts/**").permitAll()
|
||||||
.requestMatchers(HttpMethod.GET, "/api/comments/**").permitAll()
|
.requestMatchers(HttpMethod.GET, "/api/comments/**").permitAll()
|
||||||
@@ -182,7 +182,7 @@ public class SecurityConfig {
|
|||||||
}
|
}
|
||||||
} else if (!uri.startsWith("/api/auth") && !publicGet
|
} else if (!uri.startsWith("/api/auth") && !publicGet
|
||||||
&& !uri.startsWith("/api/ws") && !uri.startsWith("/api/sockjs")
|
&& !uri.startsWith("/api/ws") && !uri.startsWith("/api/sockjs")
|
||||||
&& !uri.startsWith("/v3/api-docs")) {
|
&& !uri.startsWith("/api/v3/api-docs")) {
|
||||||
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
|
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
|
||||||
response.setContentType("application/json");
|
response.setContentType("application/json");
|
||||||
response.getWriter().write("{\"error\": \"Missing token\"}");
|
response.getWriter().write("{\"error\": \"Missing token\"}");
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ rabbitmq.sharding.enabled=true
|
|||||||
|
|
||||||
# springdoc-openapi-starter-webmvc-api
|
# springdoc-openapi-starter-webmvc-api
|
||||||
# see https://springdoc.org/#springdoc-openapi-core-properties
|
# see https://springdoc.org/#springdoc-openapi-core-properties
|
||||||
springdoc.api-docs.path=/v3/api-docs
|
springdoc.api-docs.path=/api/v3/api-docs
|
||||||
springdoc.api-docs.enabled=true
|
springdoc.api-docs.enabled=true
|
||||||
springdoc.info.title=OpenIsle
|
springdoc.info.title=OpenIsle
|
||||||
springdoc.info.description=OpenIsle Open API Documentation
|
springdoc.info.description=OpenIsle Open API Documentation
|
||||||
|
|||||||
Reference in New Issue
Block a user