|
@@ -112,6 +112,8 @@ func (this *SysRoleController) Edit() {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ oldRoleName := item.RoleName
|
|
|
|
+ oldRoleCodeType := item.RoleTypeCode
|
|
roleTypeCode := services.GetRoleTypeCode(req.RoleType)
|
|
roleTypeCode := services.GetRoleTypeCode(req.RoleType)
|
|
err = system.ModifySysRole(req.RoleName, req.RoleType, roleTypeCode, req.RoleId)
|
|
err = system.ModifySysRole(req.RoleName, req.RoleType, roleTypeCode, req.RoleId)
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -119,6 +121,16 @@ func (this *SysRoleController) Edit() {
|
|
br.ErrMsg = "修改失败,Err:" + err.Error()
|
|
br.ErrMsg = "修改失败,Err:" + err.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ if oldRoleName != req.RoleName || oldRoleCodeType != roleTypeCode {
|
|
|
|
+ // 查询所有和角色相关的管理员的信息,并更新成最新的角色
|
|
|
|
+ err = system.UpdateAdminRoleInfoByRoleId(req.RoleId, req.RoleName, roleTypeCode)
|
|
|
|
+ if err != nil {
|
|
|
|
+ br.Msg = "操作失败"
|
|
|
|
+ br.ErrMsg = "更新管理员角色信息失败, Err: " + err.Error()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
// 同步角色缓存
|
|
// 同步角色缓存
|
|
var syncData system.SyncRoleData
|
|
var syncData system.SyncRoleData
|