feat: add wechat pay

This commit is contained in:
Rogee
2025-01-14 14:42:08 +08:00
parent 52c17b63bb
commit 9cd7659d14
32 changed files with 1431 additions and 110 deletions

View File

@@ -1,9 +1,6 @@
package tenants
import (
"time"
"backend/app/consts"
"backend/providers/jwt"
"backend/providers/otel"
@@ -40,20 +37,11 @@ func (c *Controller) Index(ctx fiber.Ctx, tenant string, claim *jwt.Claims) erro
return err
}
if claim.TenantID == nil {
claim.TenantID = &tenantModel.ID
token, err := c.jwt.CreateToken(claim)
if err != nil {
return err
}
ctx.Cookie(&fiber.Cookie{
Name: consts.TokenTypeUser.String(),
Value: token,
Expires: time.Now().Add(6 * time.Hour),
HTTPOnly: true,
})
}
// set tenant cookie
ctx.Cookie(&fiber.Cookie{
Name: "tenant",
Value: tenantModel.Slug,
})
// TODO: render page
return nil