diff --git a/src/main/java/dev/surl/surl/cfg/BaseConfig.kt b/src/main/java/dev/surl/surl/cfg/BaseConfig.kt index c4dd393..4c53bc4 100644 --- a/src/main/java/dev/surl/surl/cfg/BaseConfig.kt +++ b/src/main/java/dev/surl/surl/cfg/BaseConfig.kt @@ -40,8 +40,12 @@ class BaseConfig( /** * JWT密钥 */ - secret: String = numberToKey(Date().time).repeat(5), + secret: String, ) { - val secretKey: SecretKey = Keys.hmacShaKeyFor(secret.toByteArray()) + val secretKey: SecretKey = Keys.hmacShaKeyFor(if (secret.isBlank()) { + numberToKey(Date().time).repeat(10).toByteArray().apply { shuffle() } + } else { + secret.toByteArray() + }) val whiteList: List = whiteList.map { it.toRegex() } } \ No newline at end of file