|
@@ -117,6 +117,8 @@ func (this *SysRoleController) Edit() {
|
|
|
br.Msg = "角色不存在, 请刷新页面"
|
|
|
return
|
|
|
}
|
|
|
+ oldRoleCodeType := item.RoleTypeCode
|
|
|
+ oldRoleName := item.RoleName
|
|
|
exists, e := system.GetSysRoleByName(req.RoleName)
|
|
|
if e != nil && !utils.IsErrNoRow(e) {
|
|
|
br.Msg = "操作失败"
|
|
@@ -135,6 +137,16 @@ func (this *SysRoleController) Edit() {
|
|
|
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
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 同步角色缓存
|
|
|
if utils.BusinessCode == utils.BusinessCodeRelease {
|
|
|
var syncData system.SyncRoleData
|