This commit is contained in:
2025-12-20 11:05:35 +08:00
parent 788236ecc2
commit c42f2c651f
25 changed files with 245 additions and 95 deletions

View File

@@ -0,0 +1,19 @@
package middlewares
import (
"strings"
"github.com/gofiber/fiber/v3"
)
func (f *Middlewares) WechatMpVerify(ctx fiber.Ctx) error {
if !strings.HasPrefix(ctx.Path(), "/MP_verify_") {
return ctx.Next()
}
path := strings.Replace(ctx.Path(), "MP_verify_", "", 1)
path = strings.Replace(path, ".txt", "", 1)
path = strings.Trim(path, "/")
return ctx.SendString(path)
}