updata->update

Updata->Update
This commit is contained in:
rainyan
2020-04-02 20:35:19 +08:00
parent d399c588ae
commit b2dc6bfa17
24 changed files with 74 additions and 74 deletions
+2 -2
View File
@@ -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 {
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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