Commit f96109c7 authored by ryoii's avatar ryoii

Fix #71

parent 9dc50ccf
...@@ -18,6 +18,7 @@ import net.mamoe.mirai.api.http.AuthedSession ...@@ -18,6 +18,7 @@ import net.mamoe.mirai.api.http.AuthedSession
import net.mamoe.mirai.api.http.SessionManager import net.mamoe.mirai.api.http.SessionManager
import net.mamoe.mirai.api.http.data.NoSuchBotException import net.mamoe.mirai.api.http.data.NoSuchBotException
import net.mamoe.mirai.api.http.data.StateCode import net.mamoe.mirai.api.http.data.StateCode
import net.mamoe.mirai.api.http.data.common.DTO
import net.mamoe.mirai.api.http.data.common.VerifyDTO import net.mamoe.mirai.api.http.data.common.VerifyDTO
import kotlin.coroutines.EmptyCoroutineContext import kotlin.coroutines.EmptyCoroutineContext
...@@ -28,7 +29,7 @@ fun Application.authModule() { ...@@ -28,7 +29,7 @@ fun Application.authModule() {
if (it.authKey != SessionManager.authKey) { if (it.authKey != SessionManager.authKey) {
call.respondStateCode(StateCode(1, "Auth Key错误")) call.respondStateCode(StateCode(1, "Auth Key错误"))
} else { } else {
call.respondStateCode(StateCode(0, SessionManager.createTempSession().key)) call.respondDTO(AuthRetDTO(0, SessionManager.createTempSession().key))
} }
} }
...@@ -55,6 +56,9 @@ fun Application.authModule() { ...@@ -55,6 +56,9 @@ fun Application.authModule() {
} }
} }
@Serializable
private data class AuthRetDTO(val code: Int, val session: String) : DTO
@Serializable @Serializable
private data class BindDTO(override val sessionKey: String, val qq: Long) : VerifyDTO() private data class BindDTO(override val sessionKey: String, val qq: Long) : VerifyDTO()
......
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