Refactor:1; Fix:2; Feat:1 #15

Merged
FatttSnake merged 4 commits from FatttSnake into dev 2024-03-18 17:31:26 +08:00
3 changed files with 3 additions and 3 deletions
Showing only changes of commit 9fe6333aeb - Show all commits

View File

@@ -59,7 +59,7 @@ fun main(args: Array<String>) {
OxygenApiApplication::class.java.getResource("/application-config-template.yml")?.readText()?.let {
File("data/application-config.example.yml").writeText(
it.replace(
"\$uuid\$", UUID.randomUUID().toString().replace("-", "")
"\$uuid\$", UUID.randomUUID().toString()
)
)
}

View File

@@ -25,7 +25,7 @@ object JwtUtil {
* @since 1.0.0
*/
private fun generalKey(): SecretKeySpec {
val encodeKey = Base64.getDecoder().decode(SecurityProperties.jwtKey)
val encodeKey = Base64.getEncoder().encode(SecurityProperties.jwtKey.toByteArray())
return SecretKeySpec(encodeKey, 0, encodeKey.size, "AES")
}

View File

@@ -11,7 +11,7 @@ app:
# token-prefix: "Bearer " # Token prefix
# jwt-ttl: 2 # The life of token
# jwt-ttl-unit: hours # Unit of life of token [nanoseconds, microseconds, milliseconds, seconds, minutes, hours, days]
jwt-key: $uuid$ # Key to generate token (Only numbers and letters allow)
jwt-key: $uuid$ # Key to generate token
# jwt-issuer: Oxygen # Token issuer
# redis-ttl: 20 # The life of token in redis
# redis-ttl-unit: minutes # Unit of life of token in redis [nanoseconds, microseconds, milliseconds, seconds, minutes, hours, days]