Commit 9b4bacc2 authored by ryoii's avatar ryoii

remove AuthResDTO

parent 4ba2b34a
...@@ -4,6 +4,3 @@ import kotlinx.serialization.Serializable ...@@ -4,6 +4,3 @@ import kotlinx.serialization.Serializable
@Serializable @Serializable
data class AuthDTO(val authKey: String) : DTO 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() { ...@@ -14,9 +14,9 @@ fun Application.authModule() {
routing { routing {
miraiAuth("/auth") { miraiAuth("/auth") {
if (it.authKey != SessionManager.authKey) { if (it.authKey != SessionManager.authKey) {
call.respondDTO(AuthResDTO(1, "")) call.respondStateCode(StateCode(1, "Auth Key错误"))
} else { } else {
call.respondDTO(AuthResDTO(0, SessionManager.createTempSession().key)) call.respondStateCode(StateCode(0, SessionManager.createTempSession().key))
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment