Explorar o código

角色重命名

xyxie hai 6 meses
pai
achega
ac7dbf36d2
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      controllers/sys_role.go

+ 1 - 1
controllers/sys_role.go

@@ -119,7 +119,7 @@ func (this *SysRoleController) Edit() {
 		br.ErrMsg = "获取重名角色失败, Err: " + e.Error()
 		return
 	}
-	if exists != nil && exists.RoleId != item.RoleId {
+	if e == nil && exists.RoleId > 0 && exists.RoleId != item.RoleId {
 		br.Msg = "名称已存在,请重新输入"
 		return
 	}