remove @springbootTest
Change-Id: Iea186ebd05298d2804b7c6b418581e2cc935fab7
diff --git a/src/main/java/com/example/g8backend/config/JwtConfig.java b/src/main/java/com/example/g8backend/config/JwtConfig.java
new file mode 100644
index 0000000..f824797
--- /dev/null
+++ b/src/main/java/com/example/g8backend/config/JwtConfig.java
@@ -0,0 +1,24 @@
+package com.example.g8backend.config;
+
+
+import io.jsonwebtoken.security.Keys;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import javax.crypto.SecretKey;
+import java.nio.charset.StandardCharsets;
+
+@Configuration
+public class JwtConfig {
+ private static final String SECRET_KEY = "this-is-a-very-long-256-bit-secret-key-for-JWT"; //
+ private static final long EXPIRATION_MS = 3600_000; // 1小时
+
+ @Bean
+ public SecretKey jwtSecretKey() {
+ return Keys.hmacShaKeyFor(SECRET_KEY.getBytes(StandardCharsets.UTF_8));
+ }
+
+ public long getExpirationMs() {
+ return EXPIRATION_MS;
+ }
+}
+