api管理测试完成,修复casbin的API更新随动map[string]string改为map[string]interface{}
This commit is contained in:
@@ -58,8 +58,7 @@ func AddCasbin(cm model.CasbinModel) bool {
|
||||
// @return error
|
||||
|
||||
func UpdateCasbinApi(oldPath string, newPath string, oldMethod string, newMethod string) error {
|
||||
var cs []model.CasbinModel
|
||||
err := global.GVA_DB.Table("casbin_rule").Where("v1 = ? AND v2 = ?", oldPath, oldMethod).Find(&cs).Updates(map[string]string{
|
||||
err := global.GVA_DB.Table("casbin_rule").Model(&model.CasbinModel{}).Where("v1 = ? AND v2 = ?", oldPath, oldMethod).Updates(map[string]interface{}{
|
||||
"v1": newPath,
|
||||
"v2": newMethod,
|
||||
}).Error
|
||||
|
||||
Reference in New Issue
Block a user