From 14082b3e7bc50bcaaf6869087c367b4b2774c8c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=89=E9=91=AB=E5=8D=87?= Date: Tue, 23 Jun 2026 20:28:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B7=B1=E9=93=BE):=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=A9=BA=E5=93=8D=E5=BA=94=E4=BD=93=E4=B9=9F?= =?UTF-8?q?=E5=88=A4=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dropSixOrSevenData 成功时返回空响应体,原 success: obj.success === true 永远为 false,导致删除已成功却总弹「清除失败/无法覆盖」。改为 success: obj.success !== false:请求未抛错即算成功,仅显式 {success:false} 才失败。 Co-Authored-By: Claude Opus 4.8 (1M context) --- frontend-web/src/core/auth/task-purpose.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend-web/src/core/auth/task-purpose.ts b/frontend-web/src/core/auth/task-purpose.ts index 2db6b42e..eb3dfed4 100644 --- a/frontend-web/src/core/auth/task-purpose.ts +++ b/frontend-web/src/core/auth/task-purpose.ts @@ -282,12 +282,14 @@ export async function deleteTaskPurpose( if (!cfg.deleteUrl) return { message: "缺少删除接口地址", success: false }; // 只放要传的那个 id key:另一参数直接不出现在 URL(axios 不会序列化缺省 key)。 const params = idKind === "action" ? { actionId: id } : { taskId: id }; + // 该删除接口(dropSixOrSevenData)成功时**什么都不返回**(空响应体),所以只要请求没抛错 + // (HTTP 成功)就直接判定为成功;仅当后端偶尔回了 {success:false} 这类显式失败标记才算失败。 const body = await requestCrudService.get(cfg.deleteUrl, params); const obj = body && typeof body === "object" ? (body as unknown as Record) : {}; return { message: typeof obj.message === "string" ? obj.message : "", - success: obj.success === true, + success: obj.success !== false, }; }