加入自动刷新RefreshToken的逻辑
This commit is contained in:
@@ -152,7 +152,6 @@ fun Application.User(config: AppConfig) {
|
||||
generateRefreshToken(config, userId)
|
||||
)
|
||||
)
|
||||
BaseResponse(data = generateAccessToken(config, userId))
|
||||
} catch (ex: Exception) {
|
||||
BaseResponse(status = false, message = "token解析错误", data = null)
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ object TokenUtils {
|
||||
}
|
||||
|
||||
fun generateRefreshToken(config: AppConfig, userId: UUID): Token {
|
||||
return generateToken(config, userId, 10 * 24 * 60 * 60, "refresh_token")
|
||||
return generateToken(config, userId, 20 * 24 * 60 * 60, "refresh_token")
|
||||
}
|
||||
|
||||
fun getUserIdByToken(call: ApplicationCall) : UUID{
|
||||
|
||||
@@ -13,7 +13,6 @@ fun Application.configureCORS() {
|
||||
anyHost()
|
||||
allowHost("localhost:8089")
|
||||
allowHost("127.0.0.1:8089")
|
||||
allowHost("171.212.101.199:8089")
|
||||
allowHost("ai.ronsunny.cn:8089")
|
||||
|
||||
// 进一步配置 CORS
|
||||
|
||||
Reference in New Issue
Block a user