From d5f0b1c61abf3f794e82c9e9e2601089d228798b Mon Sep 17 00:00:00 2001 From: HuanCheng65 <22636177+HuanCheng65@users.noreply.github.com> Date: Fri, 21 Jul 2023 18:25:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=BE=E6=8A=A5=E8=B4=B4=E5=AD=90?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../post/api/interfaces/impls/MixedTiebaApiImpl.kt | 2 +- .../post/api/retrofit/interfaces/OfficialTiebaApi.kt | 10 ++++++++++ .../tieba/post/ui/page/thread/ThreadPage.kt | 6 +++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/huanchengfly/tieba/post/api/interfaces/impls/MixedTiebaApiImpl.kt b/app/src/main/java/com/huanchengfly/tieba/post/api/interfaces/impls/MixedTiebaApiImpl.kt index 44188250..091d8b19 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/api/interfaces/impls/MixedTiebaApiImpl.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/api/interfaces/impls/MixedTiebaApiImpl.kt @@ -790,7 +790,7 @@ object MixedTiebaApiImpl : ITiebaApi { ) override fun checkReportPost(postId: String): Call = - RetrofitTiebaApi.MINI_TIEBA_API.checkReport( + RetrofitTiebaApi.OFFICIAL_TIEBA_API.checkReport( category = "1", reportParam = mapOf( "pid" to postId diff --git a/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/interfaces/OfficialTiebaApi.kt b/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/interfaces/OfficialTiebaApi.kt index 8d8b5ae3..271fc8d0 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/interfaces/OfficialTiebaApi.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/interfaces/OfficialTiebaApi.kt @@ -470,4 +470,14 @@ interface OfficialTiebaApi { @retrofit2.http.Header(Header.COOKIE) cookie: String = "ka=open;BAIDUID=${ClientUtils.baiduId}".takeIf { ClientUtils.baiduId != null } ?: "ka=open", ): Flow + + @Headers("${Header.FORCE_LOGIN}: ${Header.FORCE_LOGIN_TRUE}") + @POST("/c/f/ueg/checkjubao") + @FormUrlEncoded + fun checkReport( + @Field("category") category: String, + @FieldMap reportParam: Map, + @Field("stoken") stoken: String? = AccountUtil.getLoginInfo() + ?.sToken + ): Call } \ No newline at end of file diff --git a/app/src/main/java/com/huanchengfly/tieba/post/ui/page/thread/ThreadPage.kt b/app/src/main/java/com/huanchengfly/tieba/post/ui/page/thread/ThreadPage.kt index 7af3517c..25062956 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/ui/page/thread/ThreadPage.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/ui/page/thread/ThreadPage.kt @@ -843,9 +843,13 @@ fun ThreadPage( ) }, onReportClick = { + val firstPostId = + thread?.get { firstPostId }.takeIf { it != 0L } + ?: firstPost?.get { id } + ?: 0L TiebaUtil.reportPost( context, - thread?.get { postId }.toString() + firstPostId.toString() ) }, modifier = Modifier