minor fix
This commit is contained in:
parent
2753bb092a
commit
dc7da1b095
@ -121,7 +121,7 @@ namespace ZR.Service
|
|||||||
/// <param name="role"></param>
|
/// <param name="role"></param>
|
||||||
public void CheckRoleAllowed(SysRole role)
|
public void CheckRoleAllowed(SysRole role)
|
||||||
{
|
{
|
||||||
if (IsAdmin(role.RoleId))
|
if (IsRoleAdmin(role.RoleId))
|
||||||
{
|
{
|
||||||
throw new CustomException("不允许操作超级管理员角色");
|
throw new CustomException("不允许操作超级管理员角色");
|
||||||
}
|
}
|
||||||
@ -191,6 +191,18 @@ namespace ZR.Service
|
|||||||
return ((IList)roles).Contains("admin");
|
return ((IList)roles).Contains("admin");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 判断是否是管理员
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userid"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool IsRoleAdmin(long roleid)
|
||||||
|
{
|
||||||
|
var roleInfo = GetFirst(x => x.RoleId == roleid);
|
||||||
|
|
||||||
|
return roleInfo.RoleKey == "admin";
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取角色菜单id集合
|
/// 获取角色菜单id集合
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -439,7 +439,7 @@ export default {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.form.type = "add";
|
this.form.type = "add";
|
||||||
this.form.menuIds = this.getMenuAllCheckedKeys();
|
//this.form.menuIds = this.getMenuAllCheckedKeys();
|
||||||
addRole(this.form).then((response) => {
|
addRole(this.form).then((response) => {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
this.open = false;
|
this.open = false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user