优化领取页角色绑定校验

This commit is contained in:
yml
2026-05-31 23:39:15 +08:00
parent 9172e1f98e
commit 60cf7c2bbd
10 changed files with 398 additions and 65 deletions
@@ -26,6 +26,8 @@ import {
import { isKuaishouEticketMockTicketCode } from '../platforms/kuaishou-eticket/mock-ticket-service.js'
import {
dispatchKuaishouCloudFulfillmentTask,
hasKuaishouCloudCustomerRole,
hasKuaishouCloudDefaultRoleSnapshot,
maskCode,
normalizeKuaishouCloudFlow,
prepareKuaishouCloudFulfillmentTask,
@@ -478,6 +480,19 @@ export async function confirmKuaishouCloudClaimRole(token: unknown) {
})
}
const hasDefaultRoleSnapshot = hasKuaishouCloudDefaultRoleSnapshot(flow)
if (!mockMode && !hasKuaishouCloudCustomerRole(flow)) {
const message = hasDefaultRoleSnapshot
? '当前仍是虚拟机默认角色,请先重新绑定自己的角色信息'
: '系统还未获取到虚拟机默认角色信息,请稍后刷新角色信息后再试'
throw createHttpError(message, {
statusCode: 409,
errorCode: hasDefaultRoleSnapshot
? 'claim_kuaishou_cloud_default_role_not_rebound'
: 'claim_kuaishou_cloud_default_role_not_ready',
})
}
await updateTask(context.task.id, {
task_status: TASK_STATUS.ROLE_CONFIRMED,
role_id: flow.binding.roleId,