MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / runLocalAutoBindInBackground

Function runLocalAutoBindInBackground

static/js/payment.js:2415–2441  ·  view source on GitHub ↗
(task, bindData)

Source from the content-addressed store, hash-verified

2413}
2414
2415async function runLocalAutoBindInBackground(task, bindData) {
2416 try {
2417 const autoResult = await submitLocalAutoBind(task, bindData);
2418 if (autoResult?.verified) {
2419 toast.success(`任务 #${task.id} 全自动绑卡完成: ${String(autoResult.subscription_type || "").toUpperCase()}`);
2420 } else if (autoResult?.paid_confirmed) {
2421 toast.success(`任务 #${task.id} 已确认支付,等待订阅同步(可点“同步订阅”)`, 7000);
2422 } else if (autoResult?.pending || autoResult?.need_user_action) {
2423 const stage = String(autoResult?.local_auto?.stage || autoResult?.local_auto?.error || "challenge").toUpperCase();
2424 toast.warning(
2425 `任务 #${task.id} 全自动绑卡已提交(${stage}),请在支付页完成验证后点击“我已完成支付”或“同步订阅”。`,
2426 9000
2427 );
2428 } else {
2429 const sub = String(autoResult?.subscription_type || "free").toUpperCase();
2430 toast.warning(`任务 #${task.id} 全自动绑卡执行完成,但当前订阅为 ${sub},请稍后再同步`, 7000);
2431 }
2432 } catch (autoErr) {
2433 toast.error(`任务 #${task.id} 全自动绑卡失败: ${formatErrorMessage(autoErr)}`);
2434 } finally {
2435 try {
2436 await loadBindCardTasks();
2437 } catch (_) {
2438 // 忽略刷新异常,避免覆盖前面的业务提示
2439 }
2440 }
2441}
2442
2443// 生成并创建绑卡任务
2444async function createBindCardTask() {

Callers 1

createBindCardTaskFunction · 0.85

Calls 6

submitLocalAutoBindFunction · 0.85
formatErrorMessageFunction · 0.85
loadBindCardTasksFunction · 0.85
successMethod · 0.80
warningMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected