| 11 | import org.springframework.stereotype.Component; |
| 12 | |
| 13 | @Data |
| 14 | @Component |
| 15 | @ConfigurationProperties(prefix = "smart-hr.jwt") |
| 16 | public class JwtProperties { |
| 17 | |
| 18 | /** |
| 19 | * JWT 密钥 |
| 20 | */ |
| 21 | private String secret; |
| 22 | |
| 23 | /** |
| 24 | * Token 过期时间(毫秒),默认 24 小时 |
| 25 | */ |
| 26 | private Long expiration = 86400000L; |
| 27 | |
| 28 | /** |
| 29 | * Refresh Token 过期时间(毫秒),默认 7 天 |
| 30 | */ |
| 31 | private Long refreshExpiration = 604800000L; |
| 32 | |
| 33 | /** |
| 34 | * Token 前缀 |
| 35 | */ |
| 36 | private String tokenPrefix = "Bearer "; |
| 37 | |
| 38 | /** |
| 39 | * Header 名称 |
| 40 | */ |
| 41 | private String headerName = "Authorization"; |
| 42 | } |
| 43 | |
| 44 |
nothing calls this directly
no outgoing calls
no test coverage detected