修复 lewan 换绑:旧号被 CT 回收时自动新取号出链

退号失败(含权限不足)不再卡住换绑,默认跳过并重新取号生成绑链;
CT 错误返回补充账号/vn 诊断信息,避免误判为后台角色权限问题。
This commit is contained in:
yml2213
2026-07-11 12:13:07 +08:00
parent 792680bd19
commit b0c77e5842
10 changed files with 750 additions and 61 deletions
@@ -181,8 +181,16 @@ export async function getCloudtentaclesBindUrl(payload: JsonObject = {}) {
method: 'POST',
token,
body: { id, key },
businessErrorStatusCode: 401,
businessErrorStatusCode: 409,
businessErrorCode: 'cloudtentacles_vn_bind_url_failed',
sourceKey: payload.sourceKey || payload.resolvedSourceKey,
accountLabel: payload.accountLabel,
context: {
operation: 'vn_bind_url',
vnKey: key,
vnId: id,
sourceKey: payload.sourceKey || payload.resolvedSourceKey || '',
},
})
return {
@@ -340,8 +348,17 @@ export async function backCloudtentaclesVirtualNumber(payload: JsonObject = {})
method: 'POST',
token,
body: { key, id },
businessErrorStatusCode: 401,
// 409:业务失败,避免前端/客服误判为后台登录或角色权限问题
businessErrorStatusCode: 409,
businessErrorCode: 'cloudtentacles_vn_back_failed',
sourceKey: payload.sourceKey || payload.resolvedSourceKey,
accountLabel: payload.accountLabel,
context: {
operation: 'vn_back',
vnKey: key,
vnId: id,
sourceKey: payload.sourceKey || payload.resolvedSourceKey || '',
},
})
return {