fix: abort機制

This commit is contained in:
skytek_xinliang
2026-06-01 14:50:47 +08:00
parent f61432ad8a
commit 915f3b7f2f
9 changed files with 70 additions and 16 deletions
+7
View File
@@ -21,3 +21,10 @@
## 資料流
store 可以呼叫 service module。component 不應繞過 store/composable 直接處理 token、session 或 HTTP hooks。
## 請求取消慣例
- 需要避免重複提交或快速切換造成的舊請求殘留時,在 store 層管理 `AbortController`
- 同一類請求使用固定 key(例如 `auth/login``menu/get-menu`),新請求前先取消舊請求。
- service module 只接收 `signal`,不管理 controller lifecycle。
- store 在 `finally` 清理該 key,在 `clear/logout` 清理全部 key。