This commit is contained in:
oneao committed 2026-01-13 22:18:01 +08:00
1 parent 6277fb2f9e
commit 8ecac0d7dd
270 files changed
+40438 -529

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
package pathx
import (
"allapp/conf"
"strings"
)
// MatchPath 判断给定路径是否在白名单中
func MatchPath(path string, whitelist []string) bool {
baseUrl := conf.GetConf().Server.BaseUrl
for _, p := range whitelist {
fullPath := baseUrl + p
if strings.HasPrefix(path, fullPath) {
return true
}
}
return false
}