😎修复更新账号时逻辑判断错误
This commit is contained in:
parent
aad540a7bc
commit
2c7db8bcd3
@ -52,7 +52,7 @@
|
|||||||
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.5" />
|
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.5" />
|
||||||
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="3.11.0" />
|
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="3.11.0" />
|
||||||
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="3.13.0" />
|
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="3.13.0" />
|
||||||
<PackageReference Include="SqlSugar.MongoDbCore" Version="5.1.4.227" />
|
<PackageReference Include="SqlSugar.MongoDbCore" Version="5.1.4.229" />
|
||||||
<PackageReference Include="SqlSugarCore" Version="5.1.4.198" />
|
<PackageReference Include="SqlSugarCore" Version="5.1.4.198" />
|
||||||
<PackageReference Include="SSH.NET" Version="2025.0.0" />
|
<PackageReference Include="SSH.NET" Version="2025.0.0" />
|
||||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.6.6" />
|
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.6.6" />
|
||||||
|
|||||||
@ -146,8 +146,7 @@ public class SysUserService : IDynamicApiController, ITransient
|
|||||||
if (await query.AnyAsync(u => u.Account == input.Account)) throw Oops.Oh(ErrorCodeEnum.D1003);
|
if (await query.AnyAsync(u => u.Account == input.Account)) throw Oops.Oh(ErrorCodeEnum.D1003);
|
||||||
if (!string.IsNullOrWhiteSpace(input.Phone) && await query.AnyAsync(u => u.Phone == input.Phone)) throw Oops.Oh(ErrorCodeEnum.D1032);
|
if (!string.IsNullOrWhiteSpace(input.Phone) && await query.AnyAsync(u => u.Phone == input.Phone)) throw Oops.Oh(ErrorCodeEnum.D1032);
|
||||||
|
|
||||||
var user = input.Adapt<SysUser>();
|
await _sysUserRep.AsUpdateable(input.Adapt<SysUser>()).IgnoreColumns(true).IgnoreColumns(u => new { u.Password, u.Status, u.TenantId }).ExecuteCommandAsync();
|
||||||
await _sysUserRep.AsUpdateable(user).IgnoreColumns(true).IgnoreColumns(u => new { u.Password, u.Status, u.TenantId }).ExecuteCommandAsync();
|
|
||||||
|
|
||||||
// 更新用户附属机构
|
// 更新用户附属机构
|
||||||
await UpdateRoleAndExtOrg(input);
|
await UpdateRoleAndExtOrg(input);
|
||||||
@ -156,6 +155,7 @@ public class SysUserService : IDynamicApiController, ITransient
|
|||||||
SqlSugarFilter.DeleteUserOrgCache(input.Id, _sysUserRep.Context.CurrentConnectionConfig.ConfigId.ToString());
|
SqlSugarFilter.DeleteUserOrgCache(input.Id, _sysUserRep.Context.CurrentConnectionConfig.ConfigId.ToString());
|
||||||
|
|
||||||
// 若账号的角色和组织架构发生变化,则强制下线账号进行权限更新
|
// 若账号的角色和组织架构发生变化,则强制下线账号进行权限更新
|
||||||
|
var user = await _sysUserRep.GetByIdAsync(input.Id);
|
||||||
var roleIds = await _sysUserRoleService.GetUserRoleIdList(input.Id);
|
var roleIds = await _sysUserRoleService.GetUserRoleIdList(input.Id);
|
||||||
if (input.OrgId != user.OrgId || !input.RoleIdList.OrderBy(u => u).SequenceEqual(roleIds.OrderBy(u => u)))
|
if (input.OrgId != user.OrgId || !input.RoleIdList.OrderBy(u => u).SequenceEqual(roleIds.OrderBy(u => u)))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user