feat(account): 添加从 CRS 同步账户功能

- 添加账户同步 API 接口 (account_handler.go)
- 实现 CRS 同步服务 (crs_sync_service.go)
- 添加前端同步对话框组件 (SyncFromCrsModal.vue)
- 更新账户管理界面支持同步操作
- 添加账户仓库批量创建方法
- 添加中英文国际化翻译
- 更新依赖注入配置
This commit is contained in:
ianshaw
2025-12-24 08:48:58 -08:00
parent adcb7bf00e
commit 6553828008
13 changed files with 1127 additions and 3 deletions

View File

@@ -244,6 +244,28 @@ export async function getAvailableModels(id: number): Promise<ClaudeModel[]> {
return data;
}
export async function syncFromCrs(params: {
base_url: string;
username: string;
password: string;
sync_proxies?: boolean;
}): Promise<{
created: number;
updated: number;
skipped: number;
failed: number;
items: Array<{
crs_account_id: string;
kind: string;
name: string;
action: string;
error?: string;
}>;
}> {
const { data } = await apiClient.post('/admin/accounts/sync/crs', params);
return data;
}
export const accountsAPI = {
list,
getById,
@@ -263,6 +285,7 @@ export const accountsAPI = {
generateAuthUrl,
exchangeCode,
batchCreate,
syncFromCrs,
};
export default accountsAPI;