feat ✨ 接口管理模块添加列排序

This commit is contained in:
wenjianzhang committed 2021-05-24 16:30:21 +08:00
1 parent 7880151ef2
commit cc74686108
3 files changed
+11 -13

No files matched your search

+7 -8
View File
@@ -77,18 +77,17 @@ func (e *SysApi) CheckStorageSysApi(c *[]runtime.Router) error {
// UpdateSysApi 修改SysApi对象
func (e *SysApi) UpdateSysApi(c *dto.SysApiControl, p *actions.DataPermission) error {
var model = models.SysApi{}
e.Orm.Scopes(
actions.Permission(model.TableName(), p),
).First(&model, c.GetId())
db := e.Orm.Debug().First(&model, c.GetId())
if db.RowsAffected == 0 {
return errors.New("无权更新该数据")
}
c.Generate(&model)
db := e.Orm.Save(&model)
db = e.Orm.Save(&model)
if err := db.Error; err != nil {
e.Log.Errorf("Service UpdateSysApi error:%s", err)
return err
}
if db.RowsAffected == 0 {
return errors.New("无权更新该数据")
}
return nil
}
@@ -108,4 +107,4 @@ func (e *SysApi) RemoveSysApi(d *dto.SysApiById, p *actions.DataPermission) erro
return errors.New("无权删除该数据")
}
return nil
}
}