修复个人中心问题
This commit is contained in:
@@ -32,11 +32,24 @@ type SyncTenantUserInput struct {
|
||||
// 注意:密码属于身份层(一人一份),因此在任一企业修改密码,
|
||||
// 该用户在其他企业的登录密码会同步变化——这是统一认证的预期行为。
|
||||
func SyncTenantUser(in SyncTenantUserInput) error {
|
||||
_, err := SyncTenantUserAndGetIdentity(in)
|
||||
return err
|
||||
}
|
||||
|
||||
// SyncTenantUserAndGetIdentity 同 SyncTenantUser,但额外返回认证中心身份ID。
|
||||
//
|
||||
// 用途:新增租户用户时先把身份建出来,再用 identity_id 作为
|
||||
// yz_system_tenant_user.uid——业务表(文件/客户/合同…)已在 uid 全量迁移中
|
||||
// 统一成 identity_id,老表 uid 只有与它一致,业务侧才不需要任何换算。
|
||||
func SyncTenantUserAndGetIdentity(in SyncTenantUserInput) (uint64, error) {
|
||||
identity, err := findOrCreateIdentity(in)
|
||||
if err != nil {
|
||||
return err
|
||||
return 0, err
|
||||
}
|
||||
return upsertTenantBinding(identity, in)
|
||||
if err := upsertTenantBinding(identity, in); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return identity.ID, nil
|
||||
}
|
||||
|
||||
// RemoveTenantUser 删除该用户在指定企业的绑定(保留身份本身,
|
||||
|
||||
Reference in New Issue
Block a user