mirror of
https://github.com/lejianwen/rustdesk-api.git
synced 2025-11-29 16:43:17 +00:00
bug fix
This commit is contained in:
@@ -65,7 +65,7 @@ func (ct *Tag) Create(c *gin.Context) {
|
||||
}
|
||||
t := f.ToTag()
|
||||
u := service.AllService.UserService.CurUser(c)
|
||||
if !service.AllService.UserService.IsAdmin(u) {
|
||||
if !service.AllService.UserService.IsAdmin(u) || t.UserId == 0 {
|
||||
t.UserId = u.Id
|
||||
}
|
||||
err := service.AllService.TagService.Create(t)
|
||||
|
||||
@@ -6,7 +6,7 @@ type TagForm struct {
|
||||
Id uint `json:"id"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
Color uint `json:"color" validate:"required"`
|
||||
UserId uint `json:"user_id" validate:"required"`
|
||||
UserId uint `json:"user_id"`
|
||||
}
|
||||
|
||||
func (f *TagForm) FromTag(group *model.Tag) *TagForm {
|
||||
|
||||
Reference in New Issue
Block a user