mirror of
https://github.com/flipped-aurora/gin-vue-admin.git
synced 2026-10-11 11:59:04 +00:00
updata->update
Updata->Update
This commit is contained in:
@@ -35,7 +35,7 @@ func (a *SysApi) DeleteApi() (err error) {
|
||||
}
|
||||
|
||||
//更新api
|
||||
func (a *SysApi) UpdataApi() (err error) {
|
||||
func (a *SysApi) UpdateApi() (err error) {
|
||||
var oldA SysApi
|
||||
flag := qmsql.DEFAULTDB.Where("path = ?", a.Path).RecordNotFound()
|
||||
if !flag {
|
||||
@@ -45,7 +45,7 @@ func (a *SysApi) UpdataApi() (err error) {
|
||||
if err != nil {
|
||||
return err
|
||||
} else {
|
||||
err = new(CasbinModel).CasbinApiUpdata(oldA.Path, a.Path)
|
||||
err = new(CasbinModel).CasbinApiUpdate(oldA.Path, a.Path)
|
||||
if err != nil {
|
||||
return err
|
||||
} else {
|
||||
|
||||
@@ -48,7 +48,7 @@ func (b *SysBaseMenu) DeleteBaseMenu(id float64) (err error) {
|
||||
}
|
||||
|
||||
//更新路由
|
||||
func (b *SysBaseMenu) UpdataBaseMenu() (err error) {
|
||||
func (b *SysBaseMenu) UpdateBaseMenu() (err error) {
|
||||
upDataMap := make(map[string]interface{})
|
||||
upDataMap["parent_id"] = b.ParentId
|
||||
upDataMap["path"] = b.Path
|
||||
|
||||
@@ -31,7 +31,7 @@ type CasbinInReceive struct {
|
||||
}
|
||||
|
||||
// 更新权限
|
||||
func (c *CasbinModel) CasbinPUpdata(AuthorityId string, casbinInfos []CasbinInfo) error {
|
||||
func (c *CasbinModel) CasbinPUpdate(AuthorityId string, casbinInfos []CasbinInfo) error {
|
||||
c.clearCasbin(0, AuthorityId)
|
||||
for _, v := range casbinInfos {
|
||||
cm := CasbinModel{
|
||||
@@ -50,7 +50,7 @@ func (c *CasbinModel) CasbinPUpdata(AuthorityId string, casbinInfos []CasbinInfo
|
||||
}
|
||||
|
||||
// API更新随动
|
||||
func (c *CasbinModel) CasbinApiUpdata(oldPath string, newPath string) error {
|
||||
func (c *CasbinModel) CasbinApiUpdate(oldPath string, newPath string) error {
|
||||
var cs []CasbinModel
|
||||
err := qmsql.DEFAULTDB.Table("casbin_rule").Where("v1 = ?", oldPath).Find(&cs).Update("v1", newPath).Error
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user