This commit is contained in:
future
2026-06-23 22:47:35 +08:00
parent 8da58a8f51
commit 3586a7d74b
65 changed files with 2694 additions and 82 deletions
@@ -58,7 +58,13 @@ public class SecurityConfig {
.pathMatchers("/api/member-card-records/**").permitAll()
.pathMatchers("/**").permitAll()
.pathMatchers("/api/member-card-transactions/**").permitAll()
.pathMatchers("/api/checkIn/**").permitAll();
.pathMatchers("/api/groupCourse/page").permitAll()
.pathMatchers("/api/checkIn/**").permitAll()
.pathMatchers("/api/payment/**").permitAll()
.pathMatchers("/api/payment/create").permitAll()
.pathMatchers("/api/payment/query").permitAll()
.pathMatchers("/api/payment/notify").permitAll()
.pathMatchers("/api/payment/refund").permitAll();
if (isDevOrTest) {
@@ -0,0 +1,46 @@
package cn.novalon.gym.manage.sys;
import cn.novalon.gym.manage.sys.security.JwtTokenProvider;
import cn.novalon.gym.manage.common.config.JwtProperties;
import org.junit.jupiter.api.Test;
public class TokenGenerator {
@Test
public void generateTokenForUser1_Dev() {
// dev环境secret
JwtProperties jwtProperties = new JwtProperties();
jwtProperties.setSecret("novalon-gym-manage-jwt-secret-key-for-development-only-2026");
JwtTokenProvider provider = new JwtTokenProvider(jwtProperties);
String token = provider.generateToken("admin", 1L);
System.out.println("【Dev环境】Token for userId=1:");
System.out.println(token);
System.out.println();
}
@Test
public void generateTokenForUser1_Local() {
// local环境secret
JwtProperties jwtProperties = new JwtProperties();
jwtProperties.setSecret("U2FsdGVkX1+vZ5Y9QmKxL8nN3rP7tW2jH4fG6dA8sB1cE5yN0zX3qV7wM4");
JwtTokenProvider provider = new JwtTokenProvider(jwtProperties);
String token = provider.generateToken("admin", 1L);
System.out.println("【Local环境】Token for userId=1:");
System.out.println(token);
System.out.println();
}
@Test
public void generateTokenForUser1_Default() {
// 默认环境secret
JwtProperties jwtProperties = new JwtProperties();
jwtProperties.setSecret("U2FsdGVkX1+vZ5Y9QmKxL8nN3rP7tW2jH4fG6dA8sB1cE5yN0zX3qV7wM4");
JwtTokenProvider provider = new JwtTokenProvider(jwtProperties);
String token = provider.generateToken("admin", 1L);
System.out.println("【默认环境】Token for userId=1:");
System.out.println(token);
}
}