权限相关问题修复

This commit is contained in:
linwenxiang committed 2021-02-22 22:00:34 +08:00
1 parent e9617ec677
commit da347e095f
9 files changed
+140 -34

No files matched your search

+13 -2
View File
@@ -12,16 +12,27 @@ type ObjectById struct {
}
func (s *ObjectById) Bind(ctx *gin.Context) error {
var err error
err = ctx.ShouldBindUri(s)
if err != nil {
return err
}
if ctx.Request.Method == http.MethodDelete {
err := ctx.ShouldBind(&s.Ids)
err = ctx.ShouldBind(&s.Ids)
if err != nil {
return err
}
if len(s.Ids) > 0 {
return nil
}
if s.Ids == nil {
s.Ids = make([]int, 0)
}
if s.Id != 0 {
s.Ids = append(s.Ids, s.Id)
}
}
return ctx.ShouldBindUri(s)
return err
}
func (s *ObjectById) GetId() interface{} {