偿还 lewan 工程债:模块拆分、默认角色降级与短链收口
将 kuaishou-cloud 大入口拆为 prepare/rebind/probe/refresh 等模块;默认角色仅作诊断;补充兑换状态单测;短链明确只读兼容历史链接。
This commit is contained in:
@@ -141,20 +141,19 @@ export function hasKuaishouCloudDefaultRoleSnapshot(flowLike: unknown) {
|
||||
return Boolean(flow.role.defaultName || flow.role.defaultRid)
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否已有可展示的绑定角色信息(诊断用)。
|
||||
*
|
||||
* 注意:履约主闸已改为 claimIdentity.expectedUid 匹配;
|
||||
* 本函数不再要求「当前角色必须不同于虚拟机默认角色」。
|
||||
*/
|
||||
export function hasKuaishouCloudCustomerRole(flowLike: unknown) {
|
||||
const flow = normalizeKuaishouCloudFlow(flowLike)
|
||||
if (!flow.binding.vnPhone || !flow.binding.roleName || !flow.binding.roleId) {
|
||||
if (!flow.binding.vnPhone) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (!hasKuaishouCloudDefaultRoleSnapshot(flow)) {
|
||||
return false
|
||||
}
|
||||
|
||||
return !isSameKuaishouCloudRoleIdentity(
|
||||
{ name: flow.binding.roleName, rid: flow.binding.roleId },
|
||||
{ name: flow.role.defaultName, rid: flow.role.defaultRid },
|
||||
)
|
||||
return Boolean(flow.binding.roleName || flow.binding.roleId)
|
||||
}
|
||||
|
||||
export function isSameKuaishouCloudRoleIdentity(
|
||||
|
||||
Reference in New Issue
Block a user