fix 增加非高级角色处理

This commit is contained in:
2025-07-09 15:57:07 +08:00
parent b2c3eb5220
commit 74eeeaa3e6

View File

@@ -94,9 +94,12 @@ public class RoleService : IRoleService
var myi = _roles.IndexOf(myRole);
var ii = _roles.IndexOf(role.Name);
if (ii <= myi)
if (ii != -1)
{
throw new UserFriendlyException("不可操作当前用户");
if (ii <= myi)
{
throw new UserFriendlyException($"不可操作当前用户({role.Name})");
}
}
}
}