fix: pageList 接口改为 POST(服务端返回405 GET不支持)

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

View File

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

View File

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