()
| 1552 | } |
| 1553 | |
| 1554 | async function retryVendorAutoTask() { |
| 1555 | const taskId = Number(vendorProgressState.taskId || 0); |
| 1556 | if (!taskId) { |
| 1557 | toast.warning("当前没有可重测任务"); |
| 1558 | return; |
| 1559 | } |
| 1560 | const fallbackConfig = collectEfunConfig(); |
| 1561 | const config = { |
| 1562 | ...(vendorProgressState.lastConfig || {}), |
| 1563 | redeem_code: String((vendorProgressState.lastConfig || {}).redeem_code || fallbackConfig.code || "").trim(), |
| 1564 | api_url: String((vendorProgressState.lastConfig || {}).api_url || fallbackConfig.api_url || "").trim(), |
| 1565 | api_key: String((vendorProgressState.lastConfig || {}).api_key || fallbackConfig.api_key || "").trim(), |
| 1566 | checkout_url: String((vendorProgressState.lastConfig || {}).checkout_url || "").trim(), |
| 1567 | }; |
| 1568 | if (!config.redeem_code) { |
| 1569 | toast.warning("请先填写兑换码"); |
| 1570 | return; |
| 1571 | } |
| 1572 | try { |
| 1573 | await startVendorAutoBind({ id: taskId }, config); |
| 1574 | toast.success(`任务 #${taskId} 已重新开始测试`); |
| 1575 | } catch (error) { |
| 1576 | toast.error(`重新测试失败: ${formatErrorMessage(error)}`); |
| 1577 | } |
| 1578 | } |
| 1579 | |
| 1580 | async function stopVendorAutoTask() { |
| 1581 | let taskId = Number(vendorProgressState.taskId || 0); |
nothing calls this directly
no test coverage detected