|
|
@ -2,9 +2,9 @@ package sysModel |
|
|
|
|
|
|
|
import ( |
|
|
|
"errors" |
|
|
|
"gin-vue-admin/init/qmsql" |
|
|
|
"github.com/casbin/casbin" |
|
|
|
gormadapter "github.com/casbin/gorm-adapter" |
|
|
|
"main/init/qmsql" |
|
|
|
"strings" |
|
|
|
) |
|
|
|
|
|
|
@ -16,8 +16,6 @@ type CasbinModel struct { |
|
|
|
Method string `json:"method" gorm:"column:v2"` |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 更新权限
|
|
|
|
func (c *CasbinModel) CasbinPUpdata(AuthorityId string, Paths []string) error { |
|
|
|
c.clearCasbin(0, AuthorityId) |
|
|
@ -30,7 +28,7 @@ func (c *CasbinModel) CasbinPUpdata(AuthorityId string,Paths []string)error{ |
|
|
|
Method: "POST", |
|
|
|
} |
|
|
|
addflag := c.AddCasbin(cm) |
|
|
|
if(addflag == false){ |
|
|
|
if addflag == false { |
|
|
|
return errors.New("存在相同api,添加失败,请联系管理员") |
|
|
|
} |
|
|
|
} |
|
|
|