优化多账号

This commit is contained in:
yml2213
2026-05-26 11:27:19 +08:00
parent d126b35579
commit 2ff320c6ac
8 changed files with 839 additions and 353 deletions
@@ -86,7 +86,7 @@ export function saveCloudtentaclesSourceByKey(sourceKey: unknown, data: JsonObje
}
/**
* Delete a single source by key. Throws if key is 'default' (cannot delete default source).
* Delete a single source by key.
*/
export function deleteCloudtentaclesSourceByKey(sourceKey: unknown) {
const key = String(sourceKey || '').trim()
@@ -96,12 +96,6 @@ export function deleteCloudtentaclesSourceByKey(sourceKey: unknown) {
errorCode: 'cloudtentacles_source_key_required',
})
}
if (key === 'default') {
throw createHttpError('不能删除默认 cloudtentacles 账号', {
statusCode: 409,
errorCode: 'cloudtentacles_default_source_forbidden',
})
}
const config = loadCloudtentaclesSourcesConfigFromFile()
const existingIndex = config.sources.findIndex(s => s.key === key)