兼容批量删除

This commit is contained in:
linwenxiang committed 2020-09-03 21:04:17 +08:00
1 parent 560e650070
commit 0ae41f247c
5 files changed
+28 -7

No files matched your search

+1 -1
View File
@@ -39,7 +39,7 @@ func DeleteAction(control dto.Control) gin.HandlerFunc {
db = db.WithContext(c).Scopes(
Permission(object.TableName(), p),
).Delete(object)
).Where(req.GetId()).Delete(object)
tools.HasError(db.Error, "删除失败", 500)
if db.RowsAffected == 0 {
err = errors.New("无权删除该数据")