try fix `_set_model_show`API
This commit is contained in:
parent
8e84f61ccb
commit
ccf670b98f
|
@ -7,3 +7,5 @@ build/
|
|||
.externalNativeBuild
|
||||
.cxx
|
||||
app/app/release
|
||||
app/arm64/release
|
||||
app/x64/release
|
||||
|
|
|
@ -7,15 +7,19 @@ import moe.protocol.servlet.CardSvc
|
|||
internal object SetModelShow: IActionHandler() {
|
||||
override suspend fun internalHandle(session: ActionSession): String {
|
||||
val model = session.getString("model")
|
||||
return invoke(model, session.echo)
|
||||
val manu = session.getString("manu")
|
||||
val modelshow = session.getString("modelshow")
|
||||
val imei = session.getString("imei")
|
||||
val show = session.getBoolean("show")
|
||||
return invoke(model, manu, modelshow, imei, show, session.echo)
|
||||
}
|
||||
|
||||
suspend operator fun invoke(model: String, echo: String = ""): String {
|
||||
CardSvc.setModelShow(model)
|
||||
suspend operator fun invoke(model: String, manu: String, modelshow: String, imei: String, show: Boolean, echo: String = ""): String {
|
||||
CardSvc.setModelShow(model, manu, modelshow, imei, show)
|
||||
return ok("成功", echo = echo)
|
||||
}
|
||||
|
||||
override val requiredParams: Array<String> = arrayOf("model")
|
||||
override val requiredParams: Array<String> = arrayOf("model", "manu", "modelshow", "imei", "show")
|
||||
|
||||
override fun path(): String = "_set_model_show"
|
||||
}
|
|
@ -27,8 +27,12 @@ fun Routing.userAction() {
|
|||
}
|
||||
|
||||
getOrPost("/_set_model_show") {
|
||||
val modelShow = fetchOrThrow("model")
|
||||
call.respondText(SetModelShow(modelShow))
|
||||
val model = fetchOrThrow("model")
|
||||
val manu = fetchOrThrow("manu")
|
||||
val modelshow = fetchOrThrow("modelshow")
|
||||
val imei = fetchOrThrow("imei")
|
||||
val show = fetchOrThrow("show").toBoolean()
|
||||
call.respondText(SetModelShow(model, manu, modelshow, imei, show))
|
||||
}
|
||||
|
||||
getOrPost("/get_model_show") {
|
||||
|
|
|
@ -55,31 +55,23 @@ internal object CardSvc: BaseSvc() {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: 出现问题,无法设置
|
||||
*/
|
||||
suspend fun setModelShow(model: String) {
|
||||
suspend fun setModelShow(model: String, manu: String, modelshow: String? = "Android", imei: String, show: Boolean = true) {
|
||||
val cookie = TicketSvc.getCookie("vip.qq.com")
|
||||
val csrf = TicketSvc.getCSRF(TicketSvc.getUin(), "vip.qq.com")
|
||||
val p4token = TicketSvc.getPt4Token(TicketSvc.getUin(), "vip.qq.com") ?: ""
|
||||
GlobalClient.post("https://club.vip.qq.com/srf-cgi-node?srfname=VIP.CustomOnlineStatusServer.CustomOnlineStatusObj.SetCustomOnlineStatus&ts=${System.currentTimeMillis()}&daid=18&g_tk=$csrf&pt4_token=$p4token") {
|
||||
header("Cookie", cookie)
|
||||
//header("referer", "https://club.vip.qq.com/onlinestatus/set?_wv=67109895&_wvx=10&_proxy=1&src=1&systemName=android&model=&msfImei=&identifier=")
|
||||
contentType(Json)
|
||||
setBody(mapOf(
|
||||
"servicesName" to "VIP.CustomOnlineStatusServer.CustomOnlineStatusObj",
|
||||
"cmd" to "SetCustomOnlineStatus",
|
||||
"args" to listOf(mapOf(
|
||||
"iAppType" to 3,
|
||||
"sIMei" to "",
|
||||
"sModel" to model.replace("+", "%20"),
|
||||
"sDeviceInfo" to "",
|
||||
"sVer" to PlatformUtils.getVersion(MobileQQ.getContext()),
|
||||
"sManu" to "undefined",
|
||||
"sIMei" to imei,
|
||||
"sModel" to model,
|
||||
"sManu" to manu,
|
||||
"lUin" to app.currentUin.toLong(),
|
||||
"bShowInfo" to true,
|
||||
"sDesc" to "",
|
||||
"sModelShow" to model.replace("+", "%20"),
|
||||
"bShowInfo" to show,
|
||||
"sModelShow" to modelshow
|
||||
))
|
||||
).json.toString())
|
||||
}.bodyAsText().let {
|
||||
|
|
Loading…
Reference in New Issue