mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-23 22:00:10 +08:00
remove AuthResDTO
This commit is contained in:
parent
4ba2b34a81
commit
9b4bacc243
@ -4,6 +4,3 @@ import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class AuthDTO(val authKey: String) : DTO
|
||||
|
||||
@Serializable
|
||||
data class AuthResDTO(val code: Int, val session: String) : DTO
|
||||
|
@ -14,9 +14,9 @@ fun Application.authModule() {
|
||||
routing {
|
||||
miraiAuth("/auth") {
|
||||
if (it.authKey != SessionManager.authKey) {
|
||||
call.respondDTO(AuthResDTO(1, ""))
|
||||
call.respondStateCode(StateCode(1, "Auth Key错误"))
|
||||
} else {
|
||||
call.respondDTO(AuthResDTO(0, SessionManager.createTempSession().key))
|
||||
call.respondStateCode(StateCode(0, SessionManager.createTempSession().key))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user