Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
127cb43c9e | |||
3dde03f117 | |||
fe4546e2b5 | |||
99281f8166 | |||
086c5f3f31 | |||
f164cc36f1 | |||
61248cc0ca |
1
.gitignore
vendored
1
.gitignore
vendored
@ -66,6 +66,7 @@ application-dev.yaml
|
|||||||
application.properties
|
application.properties
|
||||||
application.yaml
|
application.yaml
|
||||||
application-prod.yaml
|
application-prod.yaml
|
||||||
|
application-tencent.yaml
|
||||||
|
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
# 图片 / 文件上传目录(如有)
|
# 图片 / 文件上传目录(如有)
|
||||||
|
2
README.md
Normal file
2
README.md
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<h1>电科院材料所实验室仪器设备预约系统-后端项目</h1>
|
||||||
|
本项目使用SpringBoot, Mybatis-plus, SpringSecurity, easyexcel, MySQL等技术栈实现
|
2
pom.xml
2
pom.xml
@ -10,7 +10,7 @@
|
|||||||
</parent>
|
</parent>
|
||||||
<groupId>github.benjamin</groupId>
|
<groupId>github.benjamin</groupId>
|
||||||
<artifactId>equip-reserve-backend</artifactId>
|
<artifactId>equip-reserve-backend</artifactId>
|
||||||
<version>1.0.2-SNAPSHOT</version>
|
<version>1.0.3</version>
|
||||||
<name>equip-reserve-backend</name>
|
<name>equip-reserve-backend</name>
|
||||||
<description>equip-reserve-backend</description>
|
<description>equip-reserve-backend</description>
|
||||||
<url/>
|
<url/>
|
||||||
|
@ -7,6 +7,7 @@ import org.springframework.web.cors.CorsConfiguration;
|
|||||||
import org.springframework.web.cors.CorsConfigurationSource;
|
import org.springframework.web.cors.CorsConfigurationSource;
|
||||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@ -18,7 +19,7 @@ public class CorsConfig {
|
|||||||
@Bean
|
@Bean
|
||||||
public CorsConfigurationSource corsConfigurationSource() {
|
public CorsConfigurationSource corsConfigurationSource() {
|
||||||
CorsConfiguration config = new CorsConfiguration();
|
CorsConfiguration config = new CorsConfiguration();
|
||||||
config.setAllowedOriginPatterns(List.of(allowedOrigins));
|
config.setAllowedOriginPatterns(Arrays.asList(allowedOrigins.split(",")));
|
||||||
config.setAllowCredentials(true);
|
config.setAllowCredentials(true);
|
||||||
config.addAllowedHeader("*");
|
config.addAllowedHeader("*");
|
||||||
config.addAllowedMethod("*");
|
config.addAllowedMethod("*");
|
||||||
|
@ -32,6 +32,7 @@ public class SecurityConfig {
|
|||||||
.authorizeHttpRequests(auth -> auth
|
.authorizeHttpRequests(auth -> auth
|
||||||
.requestMatchers("/login").permitAll()
|
.requestMatchers("/login").permitAll()
|
||||||
.requestMatchers("/device_image/**").permitAll()
|
.requestMatchers("/device_image/**").permitAll()
|
||||||
|
.requestMatchers("/health").permitAll()
|
||||||
.anyRequest().authenticated())
|
.anyRequest().authenticated())
|
||||||
.addFilterBefore(jwtAuthFilter(), UsernamePasswordAuthenticationFilter.class)
|
.addFilterBefore(jwtAuthFilter(), UsernamePasswordAuthenticationFilter.class)
|
||||||
.build();
|
.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
|
secret: your-secret
|
||||||
equip-reserve:
|
equip-reserve:
|
||||||
device-days: 7
|
device-days: 7
|
||||||
allowed-origins: http://localhost:5173
|
allowed-origins: "http://localhost:5173,http://127.0.0.1:5173"
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
mapper-locations: classpath:mapper/*.xml
|
mapper-locations: classpath:mapper/*.xml
|
||||||
configuration:
|
configuration:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user