(id)
| 2159 | } |
| 2160 | |
| 2161 | async function uploadToCodex2api(id) { |
| 2162 | const choice = await selectCodex2apiService(); |
| 2163 | if (choice === null) return; |
| 2164 | try { |
| 2165 | toast.info('正在上传到 Codex2API...'); |
| 2166 | const payload = {}; |
| 2167 | if (choice.service_id != null) payload.service_id = choice.service_id; |
| 2168 | const result = await api.post(`/accounts/${id}/upload-codex2api`, payload); |
| 2169 | if (result.success) { |
| 2170 | toast.success('上传成功'); |
| 2171 | loadAccounts(); |
| 2172 | } else { |
| 2173 | toast.error('上传失败: ' + (result.error || result.message || '未知错误')); |
| 2174 | } |
| 2175 | } catch (e) { |
| 2176 | toast.error('上传失败: ' + e.message); |
| 2177 | } |
| 2178 | } |
| 2179 | |
| 2180 | // ============== Sub2API 上传 ============== |
| 2181 |
no test coverage detected