fixed:菜单删除功能细节调优 (#1705)
* 多文件: 菜单parentId由string改成uint * sys_base_menu.go: fix table name "sys_base_menus" specified more than once (SQLSTATE 42712) (#1704) --------- Co-authored-by: crazyrunsnail <fjyuan1991@163.com>
This commit is contained in:
@@ -2,9 +2,9 @@ package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/global"
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/model/system"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func RegisterApis(apis ...system.SysApi) {
|
||||
@@ -37,13 +37,13 @@ func RegisterMenus(menus ...system.SysBaseMenu) {
|
||||
fmt.Println("插件已安装或存在同名菜单")
|
||||
return
|
||||
}
|
||||
parentMenu.ParentId = "0"
|
||||
parentMenu.ParentId = 0
|
||||
err := global.GVA_DB.Create(&parentMenu).Error
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
for i := range otherMenus {
|
||||
pid := strconv.Itoa(int(parentMenu.ID))
|
||||
pid := parentMenu.ID
|
||||
otherMenus[i].ParentId = pid
|
||||
}
|
||||
err = global.GVA_DB.Create(&otherMenus).Error
|
||||
|
Reference in New Issue
Block a user