This commit is contained in:
ljw
2024-09-20 20:46:32 +08:00
parent 1e3403e3c5
commit 3addc12f45
2 changed files with 2 additions and 2 deletions

View File

@@ -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)