(id)
| 1076 | } |
| 1077 | |
| 1078 | async function validateToken(id) { |
| 1079 | try { |
| 1080 | toast.info('正在验证Token...'); |
| 1081 | const result = await api.post(`/accounts/${id}/validate`, {}, { |
| 1082 | timeoutMs: 30000, |
| 1083 | retry: 0, |
| 1084 | }); |
| 1085 | |
| 1086 | const nextStatus = String(result?.status || '').trim().toLowerCase(); |
| 1087 | if (nextStatus) { |
| 1088 | replaceAccountRowStatus(id, nextStatus); |
| 1089 | } |
| 1090 | |
| 1091 | if (result.valid) { |
| 1092 | toast.success('Token 验证通过'); |
| 1093 | } else { |
| 1094 | toast.warning(`Token 无效: ${result.error || '未知错误'}`, 5000); |
| 1095 | } |
| 1096 | |
| 1097 | await refreshAccountsView({ settleDelayMs: 80 }); |
| 1098 | } catch (error) { |
| 1099 | toast.error('验证失败: ' + error.message); |
| 1100 | } |
| 1101 | } |
| 1102 | |
| 1103 | async function runBatchRefreshTask(payload, count, sourceLabel, options = {}) { |
| 1104 | const showToast = options.showToast !== false; |
nothing calls this directly
no test coverage detected