diff --git a/app/svc/svc_role.go b/app/svc/svc_role.go index f1fcb22..c805e64 100644 --- a/app/svc/svc_role.go +++ b/app/svc/svc_role.go @@ -9,6 +9,7 @@ import ( "code.fnuoos.com/zhimeng/model.git/src/model" "encoding/json" "errors" + "fmt" "github.com/gin-gonic/gin" "regexp" "strings" @@ -139,7 +140,14 @@ func RoleBindPermissionGroup(c *gin.Context, req md.RoleBindPermissionGroupReq) return } - return session.Commit() + session.Commit() + var data []model.AdminRole + MasterDb(c).Where("role_id=?", role.Id).Find(&data) + for _, v := range data { + rolePermissionKey := fmt.Sprintf(md.AdminRolePermissionKey, c.GetString("mid"), utils.AnyToString(v.AdmId)) + cache.Del(rolePermissionKey) + } + return nil } func BindAdminRole(c *gin.Context, req md.BindAdminRoleReq) (err error) {