diff --git a/server/service/system/sys_api.go b/server/service/system/sys_api.go index 92c995109..a77d1d5cb 100644 --- a/server/service/system/sys_api.go +++ b/server/service/system/sys_api.go @@ -3,12 +3,13 @@ package system import ( "errors" "fmt" + "strings" + "github.com/flipped-aurora/gin-vue-admin/server/global" "github.com/flipped-aurora/gin-vue-admin/server/model/common/request" "github.com/flipped-aurora/gin-vue-admin/server/model/system" systemRes "github.com/flipped-aurora/gin-vue-admin/server/model/system/response" "gorm.io/gorm" - "strings" ) //@author: [piexlmax](https://github.com/piexlmax) @@ -135,7 +136,7 @@ func (apiService *ApiService) IgnoreApi(ignoreApi system.SysIgnoreApi) (err erro func (apiService *ApiService) EnterSyncApi(syncApis systemRes.SysSyncApis) (err error) { return global.GVA_DB.Transaction(func(tx *gorm.DB) error { var txErr error - if syncApis.NewApis != nil && len(syncApis.NewApis) > 0 { + if len(syncApis.NewApis) > 0 { txErr = tx.Create(&syncApis.NewApis).Error if txErr != nil { return txErr