fix: issues

This commit is contained in:
Rogee
2024-12-16 15:01:43 +08:00
parent bfbb081a95
commit 4dc54dc5bc
3 changed files with 11 additions and 10 deletions

View File

@@ -3,7 +3,7 @@ Mode = "prod"
BaseURI = "https://qvyun.mp.jdwan.com"
[Http]
Port = 80
Port = 9600
[Swagger]
BaseRoute = "doc"
@@ -14,15 +14,15 @@ Version = "1.0.0"
[Database]
Host = "10.1.1.3"
Host = "host.local"
Database = "qvyun"
Password = "xixi0202"
[Wechat]
AppId = "wxf5bf0adeb99c2afd"
AppSecret = "3cf8fad4aa414f2b861399f111b22bb5"
AppId = "wx47649361b6eba174"
AppSecret = "e9cdf19b006cd294a9dae7ad8ae08b72"
Token = "W8Xhw5TivYBgY"
AesKey = "F6AqCxAV4W1eCrY6llJ2zapphKK49CQN3RgtPDrjhnI"
AesKey = "OlgPgMvsl92zy5oErtEzRcziRT2txoN3jgEHV6RQZMY"
DevMode = false
[JWT]
@@ -36,4 +36,4 @@ Salt = "LiXi.Y@140202"
Type = "local"
# Path = "/projects/mp-qvyun/backend/fixtures/processed"
Path = "/app/processed"
Asset = "/app/dist"
Asset = "/app/assets"

View File

@@ -35,10 +35,8 @@ func (f *Middlewares) WeChatAuth(c fiber.Ctx) error {
if state == "" && code == "" {
url := string(c.Request().URI().FullURI())
if f.app.IsDevMode() && f.app.BaseURI != nil {
url = strings.ReplaceAll(url, "http", "https")
url = strings.ReplaceAll(url, c.BaseURL(), *f.app.BaseURI)
}
url = strings.ReplaceAll(url, "http", "https")
url = strings.ReplaceAll(url, c.BaseURL(), *f.app.BaseURI)
log.WithField("module", "middleware.SilentAuth").Debug("redirect_uri: ", url)

View File

@@ -78,6 +78,9 @@ func Serve(cmd *cobra.Command, args []string) error {
engine.Use(mid.WeChatVerify)
engine.Use([]string{"/t/:tenant", "/t/:tenant/*"}, mid.WeChatAuth, http.Wechat.Render)
engine.Get("MP_verify_dEF9kn8rJlBsuLKk.txt", func(c fiber.Ctx) error {
return c.SendString("dEF9kn8rJlBsuLKk")
})
engine.Get("/posters/:tenant/:hash.jpg", func(c fiber.Ctx) error {
tenant := c.Params("tenant")
hash := c.Params("hash")