Merge branch 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gva_workflow

 Conflicts:
	server/cmd/datas/apis.go
	server/cmd/datas/menus.go
	server/model/sys_workflow.go
	server/model/sys_workflow_process.go
This commit is contained in:
pixel
2020-10-29 11:41:38 +08:00
36 changed files with 280 additions and 192 deletions
+5
View File
@@ -1,6 +1,7 @@
package datas
import (
"github.com/gookit/color"
"gorm.io/gorm"
)
@@ -70,6 +71,10 @@ var AuthorityMenus = []SysAuthorityMenus{
func InitSysAuthorityMenus(db *gorm.DB) (err error) {
return db.Table("sys_authority_menus").Transaction(func(tx *gorm.DB) error {
if tx.Where("sys_authority_authority_id IN ?", []string{"888", "8881", "9528"}).Find(&[]SysAuthorityMenus{}).RowsAffected == 53 {
color.Danger.Println("sys_authority_menus表的初始数据已存在!")
return nil
}
if tx.Create(&AuthorityMenus).Error != nil { // 遇到错误时回滚事务
return err
}