mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
@@ -2,11 +2,12 @@ package services
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/casbin"
|
||||
"gorm.io/gorm"
|
||||
"pandax/apps/system/entity"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/casbin"
|
||||
"pandax/pkg/global"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -107,7 +108,7 @@ func (m *sysApiModelImpl) Update(api entity.SysApi) *entity.SysApi {
|
||||
biz.IsTrue(errors.Is(err, gorm.ErrRecordNotFound), "存在相同api路径")
|
||||
}
|
||||
// 异常直接抛错误
|
||||
ca := casbin.CasbinS{ModelPath: global.Conf.Casbin.ModelPath}
|
||||
ca := casbin.CasbinService{ModelPath: global.Conf.Casbin.ModelPath}
|
||||
ca.UpdateCasbinApi(oldA.Path, api.Path, oldA.Method, api.Method)
|
||||
err = global.Db.Table(m.table).Model(&api).Updates(&api).Error
|
||||
biz.ErrIsNil(err, "修改api信息失败")
|
||||
|
||||
Reference in New Issue
Block a user