(taskId)
| 2795 | } |
| 2796 | |
| 2797 | async function syncBindCardTask(taskId) { |
| 2798 | try { |
| 2799 | const data = await api.post(`/payment/bind-card/tasks/${taskId}/sync-subscription`, {}, { |
| 2800 | timeoutMs: 60000, |
| 2801 | retry: 0, |
| 2802 | }); |
| 2803 | const sub = String(data?.subscription_type || "free").toUpperCase(); |
| 2804 | const source = String(data?.detail?.source || "unknown"); |
| 2805 | const confidence = String(data?.detail?.confidence || "unknown"); |
| 2806 | const note = String(data?.detail?.note || ""); |
| 2807 | const suffix = note ? `, note=${note}` : ""; |
| 2808 | const msg = `同步完成: ${sub} (source=${source}, confidence=${confidence}${suffix})`; |
| 2809 | if (sub === "PLUS" || sub === "TEAM") { |
| 2810 | toast.success(msg); |
| 2811 | } else { |
| 2812 | toast.warning(msg, 7000); |
| 2813 | } |
| 2814 | await loadBindCardTasks(); |
| 2815 | } catch (e) { |
| 2816 | toast.error(`同步订阅失败: ${formatErrorMessage(e)}`); |
| 2817 | } |
| 2818 | } |
| 2819 | |
| 2820 | async function deleteBindCardTask(taskId) { |
| 2821 | const ok = await confirm(`确认删除绑卡任务 #${taskId} 吗?`, "删除任务"); |
nothing calls this directly
no test coverage detected