fix: wechat verify

This commit is contained in:
Rogee
2025-01-10 19:44:24 +08:00
parent ab576706e7
commit 52c17b63bb
13 changed files with 83 additions and 92 deletions

View File

@@ -100,3 +100,14 @@ func (ctl *Controller) Login(ctx fiber.Ctx, code, state, redirectUri string) err
return ctx.Redirect().To(redirectUri)
}
// @Router /MP_verify_:uuid.txt [get]
// @Bind uuid path
func (ctl *Controller) Verify(ctx fiber.Ctx, uuid string) error {
v, err := ctl.wechat.VerifySite(uuid)
if err != nil {
return err
}
return ctx.SendString(v)
}

View File

@@ -40,4 +40,9 @@ func (r *Routes) Register(router fiber.Router) {
QueryParam[string]("redirectUri"),
))
router.Get("/MP_verify_:uuid.txt", Func1(
r.controller.Verify,
PathParam[string]("uuid"),
))
}