fix🐛: 修复前端设置数据权限不生效问题

fix🐛: 修复前端设置数据权限不生效问题
This commit is contained in:
wenjianzhang authored and GitHub committed 2022-03-05 11:23:41 +08:00
commit 9c8974a26e
3 files changed
+9 -6

No files matched your search

+1 -1
View File
@@ -227,7 +227,7 @@ func (e *SysRole) UpdateDataScope(c *dto.RoleDataScopeReq) *SysRole {
var dlist = make([]models.SysDept, 0)
var model = models.SysRole{}
tx.Preload("SysDept").First(&model, c.RoleId)
tx.Where("id in ?", c.DeptIds).Find(&dlist)
tx.Where("dept_id in ?", c.DeptIds).Find(&dlist)
err = tx.Model(&model).Association("SysDept").Delete(model.SysDept)
if err != nil {
e.Log.Errorf("delete SysDept error:%s", err)