允许uayu

This commit is contained in:
wintsa committed 2024-04-09 10:43:17 +08:00
1 parent 57fe832e38
commit ce06c5a0d4
13 files changed
+180 -213

No files matched your search

-3
View File
@@ -2,7 +2,6 @@ package models
import (
"encoding/json"
"fmt"
"gorm.io/gorm"
)
@@ -40,9 +39,7 @@ func (m *ModuleConfig) Save(db *gorm.DB) error {
} else {
m.ValueJson = string(jb)
}
fmt.Println("检查", m.UserId)
// 保存操作
if err := db.First(&ModuleConfig{}, "user_id=? AND name=?", m.UserId, m.Name).Error; err != nil {
if err == gorm.ErrRecordNotFound {
// 新增