|
@ -27,7 +27,7 @@ func ServeHTTP(ctx context.Context) { |
|
|
|
|
|
|
|
|
// 系统菜单不进行权限拦截
|
|
|
// 系统菜单不进行权限拦截
|
|
|
publicRutes := conf.AppConfig.PublicRute |
|
|
publicRutes := conf.AppConfig.PublicRute |
|
|
res := utils.IsContain(publicRutes,path) |
|
|
|
|
|
|
|
|
res := utils.IsContain(publicRutes, path) |
|
|
if !res { |
|
|
if !res { |
|
|
// casbin权限拦截
|
|
|
// casbin权限拦截
|
|
|
ok := casbins.CheckPermissions(ctx) |
|
|
ok := casbins.CheckPermissions(ctx) |
|
@ -35,13 +35,13 @@ func ServeHTTP(ctx context.Context) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//if !strings.Contains(path, "/sysMenu") {
|
|
|
|
|
|
// // casbin权限拦截
|
|
|
|
|
|
// ok := casbins.CheckPermissions(ctx)
|
|
|
|
|
|
// if !ok {
|
|
|
|
|
|
// return
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
if !strings.Contains(path, "/sysMenu") { |
|
|
|
|
|
// casbin权限拦截
|
|
|
|
|
|
ok := casbins.CheckPermissions(ctx) |
|
|
|
|
|
if !ok { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Pass to real API
|
|
|
// Pass to real API
|
|
|
ctx.Next() |
|
|
ctx.Next() |
|
@ -61,4 +61,3 @@ func checkURL(reqPath string) bool { |
|
|
} |
|
|
} |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
|
|
|
|