fix: 优化用户更新,超管问题

This commit is contained in:
ccnetcore
2025-06-21 13:29:41 +08:00
parent 1d16502d32
commit 35aa022984
2 changed files with 10 additions and 5 deletions

View File

@@ -145,11 +145,15 @@ namespace Yi.Framework.Rbac.Application.Services.System
/// <returns></returns>
[OperLog("更新用户", OperEnum.Update)]
[Permission("system:user:edit")]
public async override Task<UserGetOutputDto> UpdateAsync(Guid id, UserUpdateInputVo input)
public override async Task<UserGetOutputDto> UpdateAsync(Guid id, UserUpdateInputVo input)
{
if (input.UserName == UserConst.Admin || input.UserName == UserConst.TenantAdmin)
//不是超管,不能更新成超管
if (!UserConst.Admin.Equals(CurrentUser.UserName))
{
throw new UserFriendlyException(UserConst.Name_Not_Allowed);
if (input.UserName == UserConst.Admin || input.UserName == UserConst.TenantAdmin)
{
throw new UserFriendlyException(UserConst.Name_Not_Allowed);
}
}
if (await _repository.IsAnyAsync(u => input.UserName!.Equals(u.UserName) && !id.Equals(u.Id)))

View File

@@ -14,7 +14,7 @@
<el-menu-item index="2" @click="enterStart"
>开始</el-menu-item>
<el-menu-item index="3" @click="enterTemp" style="color: red;font-weight: bolder;font-size: large;"
>有偿悬赏</el-menu-item>
>意心Ai</el-menu-item>
<el-menu-item index="4" @click="enterShop"
>商城</el-menu-item>
<!-- <el-sub-menu index="4">-->
@@ -234,7 +234,8 @@ const enterStart = () => {
}
const enterTemp=()=>{
router.push("/discuss/24cc0526-86e7-aabf-e091-3a0f83c3e604/false");
alert("即将上线!意社区-高质量ai平台一心一意只为打造更良心的ai平台")
//router.push("/discuss/24cc0526-86e7-aabf-e091-3a0f83c3e604/false");
}
const enterShop=()=>{
router.push("/shop");