feat(jwt): extend token expiration time and improve authentication filter

- Extend JWT token expiration from 1 hour to 30 days
- Improve Authorization header validation in authentication filter
- Add null check for header before calling startsWith method
- Import Strings utility class for better string handling
This commit is contained in:
2025-12-01 20:08:50 +08:00
parent 7380f783ee
commit b7afe9496a
2 changed files with 2 additions and 2 deletions

View File

@@ -80,7 +80,7 @@ public class JwtTokenHelper implements InitializingBean {
*/
public String generateToken(String username) {
Instant now = Instant.now();
Instant expireTime = now.plus(1, ChronoUnit.HOURS);
Instant expireTime = now.plus(30, ChronoUnit.DAYS);
return Jwts.builder()
.header().add("type", "JWT").and() // 推荐添加 header