fix: 举报贴子失败

This commit is contained in:
HuanCheng65 2023-07-21 18:25:25 +08:00
parent c847651a70
commit d5f0b1c61a
No known key found for this signature in database
GPG Key ID: 5EC9DD60A32C7360
3 changed files with 16 additions and 2 deletions

View File

@ -790,7 +790,7 @@ object MixedTiebaApiImpl : ITiebaApi {
) )
override fun checkReportPost(postId: String): Call<CheckReportBean> = override fun checkReportPost(postId: String): Call<CheckReportBean> =
RetrofitTiebaApi.MINI_TIEBA_API.checkReport( RetrofitTiebaApi.OFFICIAL_TIEBA_API.checkReport(
category = "1", category = "1",
reportParam = mapOf( reportParam = mapOf(
"pid" to postId "pid" to postId

View File

@ -470,4 +470,14 @@ interface OfficialTiebaApi {
@retrofit2.http.Header(Header.COOKIE) cookie: String = "ka=open;BAIDUID=${ClientUtils.baiduId}".takeIf { ClientUtils.baiduId != null } @retrofit2.http.Header(Header.COOKIE) cookie: String = "ka=open;BAIDUID=${ClientUtils.baiduId}".takeIf { ClientUtils.baiduId != null }
?: "ka=open", ?: "ka=open",
): Flow<UploadPictureResultBean> ): Flow<UploadPictureResultBean>
@Headers("${Header.FORCE_LOGIN}: ${Header.FORCE_LOGIN_TRUE}")
@POST("/c/f/ueg/checkjubao")
@FormUrlEncoded
fun checkReport(
@Field("category") category: String,
@FieldMap reportParam: Map<String, String>,
@Field("stoken") stoken: String? = AccountUtil.getLoginInfo()
?.sToken
): Call<CheckReportBean>
} }

View File

@ -843,9 +843,13 @@ fun ThreadPage(
) )
}, },
onReportClick = { onReportClick = {
val firstPostId =
thread?.get { firstPostId }.takeIf { it != 0L }
?: firstPost?.get { id }
?: 0L
TiebaUtil.reportPost( TiebaUtil.reportPost(
context, context,
thread?.get { postId }.toString() firstPostId.toString()
) )
}, },
modifier = Modifier modifier = Modifier