(id)
| 2181 | |
| 2182 | // 上传单账号到 Sub2API |
| 2183 | async function uploadToSub2Api(id) { |
| 2184 | const choice = await selectSub2ApiService(); |
| 2185 | if (choice === null) return; |
| 2186 | try { |
| 2187 | toast.info('正在上传到 Sub2API...'); |
| 2188 | const payload = {}; |
| 2189 | if (choice.service_id != null) payload.service_id = choice.service_id; |
| 2190 | const result = await api.post(`/accounts/${id}/upload-sub2api`, payload); |
| 2191 | if (result.success) { |
| 2192 | toast.success('上传成功'); |
| 2193 | loadAccounts(); |
| 2194 | } else { |
| 2195 | toast.error('上传失败: ' + (result.error || result.message || '未知错误')); |
| 2196 | } |
| 2197 | } catch (e) { |
| 2198 | toast.error('上传失败: ' + e.message); |
| 2199 | } |
| 2200 | } |
| 2201 | |
| 2202 | // 更多菜单切换 |
| 2203 | function toggleMoreMenu(btn) { |
no test coverage detected