Compare commits
4 Commits
61248cc0ca
...
fe4546e2b5
Author | SHA1 | Date | |
---|---|---|---|
fe4546e2b5 | |||
99281f8166 | |||
086c5f3f31 | |||
f164cc36f1 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -66,6 +66,7 @@ application-dev.yaml
|
||||
application.properties
|
||||
application.yaml
|
||||
application-prod.yaml
|
||||
application-tencent.yaml
|
||||
|
||||
# -----------------------------
|
||||
# 图片 / 文件上传目录(如有)
|
||||
|
2
pom.xml
2
pom.xml
@ -10,7 +10,7 @@
|
||||
</parent>
|
||||
<groupId>github.benjamin</groupId>
|
||||
<artifactId>equip-reserve-backend</artifactId>
|
||||
<version>1.0.2</version>
|
||||
<version>1.0.3-SNAPSHOT</version>
|
||||
<name>equip-reserve-backend</name>
|
||||
<description>equip-reserve-backend</description>
|
||||
<url/>
|
||||
|
@ -7,6 +7,7 @@ import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.CorsConfigurationSource;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
@ -18,7 +19,7 @@ public class CorsConfig {
|
||||
@Bean
|
||||
public CorsConfigurationSource corsConfigurationSource() {
|
||||
CorsConfiguration config = new CorsConfiguration();
|
||||
config.setAllowedOriginPatterns(List.of(allowedOrigins));
|
||||
config.setAllowedOriginPatterns(Arrays.asList(allowedOrigins.split(",")));
|
||||
config.setAllowCredentials(true);
|
||||
config.addAllowedHeader("*");
|
||||
config.addAllowedMethod("*");
|
||||
|
@ -32,6 +32,7 @@ public class SecurityConfig {
|
||||
.authorizeHttpRequests(auth -> auth
|
||||
.requestMatchers("/login").permitAll()
|
||||
.requestMatchers("/device_image/**").permitAll()
|
||||
.requestMatchers("/health").permitAll()
|
||||
.anyRequest().authenticated())
|
||||
.addFilterBefore(jwtAuthFilter(), UsernamePasswordAuthenticationFilter.class)
|
||||
.build();
|
||||
|
@ -0,0 +1,14 @@
|
||||
package github.benjamin.equipreservebackend.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class HealthController {
|
||||
|
||||
@GetMapping("/health")
|
||||
public String health() {
|
||||
return "ok";
|
||||
}
|
||||
|
||||
}
|
@ -16,7 +16,7 @@ jwt:
|
||||
secret: your-secret
|
||||
equip-reserve:
|
||||
device-days: 7
|
||||
allowed-origins: http://localhost:5173
|
||||
allowed-origins: "http://localhost:5173,http://127.0.0.1:5173"
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath:mapper/*.xml
|
||||
configuration:
|
||||
|
Loading…
x
Reference in New Issue
Block a user