修改,兼容go-admin sdk方案

This commit is contained in:
linwenxiang
2021-03-09 19:12:49 +08:00
parent c541d09076
commit 25d8364bf4
151 changed files with 578 additions and 3525 deletions
+2 -3
View File
@@ -2,11 +2,10 @@ package system
import (
"fmt"
"github.com/go-admin-team/go-admin-core/sdk/pkg"
"github.com/casbin/casbin/v2"
"gorm.io/gorm"
"go-admin/tools"
)
type RoleMenu struct {
@@ -159,7 +158,7 @@ func (rm *RoleMenu) Insert(tx *gorm.DB, enforcer *casbin.SyncedEnforcer, roleId
}
func (rm *RoleMenu) Delete(tx *gorm.DB, RoleId string, MenuID string) (bool, error) {
rm.RoleId, _ = tools.StringToInt(RoleId)
rm.RoleId, _ = pkg.StringToInt(RoleId)
table := tx.Table("sys_role_menu").Where("role_id = ?", RoleId)
if MenuID != "" {
table = table.Where("menu_id = ?", MenuID)