fix:修复bug

This commit is contained in:
henry
2021-11-25 13:53:18 +08:00
parent c6b37755b9
commit a90a7880de
4 changed files with 47 additions and 21 deletions

View File

@ -5,6 +5,7 @@ import (
"ArmedPolice/config"
"ArmedPolice/serve/orm"
"ArmedPolice/utils"
"fmt"
)
type synchronized struct {
@ -78,7 +79,14 @@ func initModel() {
_ = db.Migrator().CreateTable(v.iModel)
if v.iValues != nil && v.iValues() != nil {
db.Table(v.iModel.TableName()).Create(v.iValues())
err := db.Table(v.iModel.TableName()).Create(v.iValues()).Error
if err != nil {
fmt.Println("=======================================")
fmt.Println(err)
fmt.Println("=======================================")
}
}
} else if v.Catch != nil && v.Catch() != nil {
v.Catch()