udpate
This commit is contained in:
19
backend_v1/app/middlewares/mid_wechat_mp_verify.go
Normal file
19
backend_v1/app/middlewares/mid_wechat_mp_verify.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user