允许uayu

This commit is contained in:
2024-04-09 10:43:17 +08:00
parent 57fe832e38
commit ce06c5a0d4
13 changed files with 180 additions and 213 deletions
-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 {
// 新增