fix: 任务列表改用 queryTaskIds 接口(旧版实际使用的接口)

pageList 返回空body,改为 queryTaskIds GET 请求

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dongliang
2026-04-27 21:15:15 +09:30
parent 4a3fbb6be6
commit 52949f4e3f
2 changed files with 4 additions and 5 deletions

View File

@@ -23,9 +23,9 @@ interface TaskApi {
@GET("watchTask/myCurrentAttendance") @GET("watchTask/myCurrentAttendance")
suspend fun getAttendance(): ApiResponse<AttendanceInfo> suspend fun getAttendance(): ApiResponse<AttendanceInfo>
/** 任务列表(按状态筛选,服务端要求 POST */ /** 获取任务ID列表(按状态筛选,旧版 queryTaskIds */
@POST("watchTask/pageList") @GET("watchTask/queryTaskIds")
suspend fun getTaskList(@Body params: HashMap<String, Any>): ApiResponse<List<TaskItem>> suspend fun getTaskIds(@Query("status") status: Int): ApiResponse<List<TaskItem>>
/** 任务详情 */ /** 任务详情 */
@GET("watchTask/lookTaskDetail") @GET("watchTask/lookTaskDetail")

View File

@@ -118,8 +118,7 @@ class TaskListFragment : BaseFragment<FragmentTaskListBinding>() {
private fun fetchTasks() { private fun fetchTasks() {
viewLifecycleOwner.lifecycleScope.launch { viewLifecycleOwner.lifecycleScope.launch {
binding.swipeRefresh.isRefreshing = true binding.swipeRefresh.isRefreshing = true
val params = hashMapOf<String, Any>("status" to currentStatus) val result = safeApiCall { taskApi.getTaskIds(currentStatus) }
val result = safeApiCall { taskApi.getTaskList(params) }
binding.swipeRefresh.isRefreshing = false binding.swipeRefresh.isRefreshing = false
when (result) { when (result) {