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" BaseURI = "https://qvyun.mp.jdwan.com"
[Http] [Http]
Port = 80 Port = 9600
[Swagger] [Swagger]
BaseRoute = "doc" BaseRoute = "doc"
@@ -14,15 +14,15 @@ Version = "1.0.0"
[Database] [Database]
Host = "10.1.1.3" Host = "host.local"
Database = "qvyun" Database = "qvyun"
Password = "xixi0202" Password = "xixi0202"
[Wechat] [Wechat]
AppId = "wxf5bf0adeb99c2afd" AppId = "wx47649361b6eba174"
AppSecret = "3cf8fad4aa414f2b861399f111b22bb5" AppSecret = "e9cdf19b006cd294a9dae7ad8ae08b72"
Token = "W8Xhw5TivYBgY" Token = "W8Xhw5TivYBgY"
AesKey = "F6AqCxAV4W1eCrY6llJ2zapphKK49CQN3RgtPDrjhnI" AesKey = "OlgPgMvsl92zy5oErtEzRcziRT2txoN3jgEHV6RQZMY"
DevMode = false DevMode = false
[JWT] [JWT]
@@ -36,4 +36,4 @@ Salt = "LiXi.Y@140202"
Type = "local" Type = "local"
# Path = "/projects/mp-qvyun/backend/fixtures/processed" # Path = "/projects/mp-qvyun/backend/fixtures/processed"
Path = "/app/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 == "" { if state == "" && code == "" {
url := string(c.Request().URI().FullURI()) url := string(c.Request().URI().FullURI())
if f.app.IsDevMode() && f.app.BaseURI != nil {
url = strings.ReplaceAll(url, "http", "https") url = strings.ReplaceAll(url, "http", "https")
url = strings.ReplaceAll(url, c.BaseURL(), *f.app.BaseURI) url = strings.ReplaceAll(url, c.BaseURL(), *f.app.BaseURI)
}
log.WithField("module", "middleware.SilentAuth").Debug("redirect_uri: ", url) 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(mid.WeChatVerify)
engine.Use([]string{"/t/:tenant", "/t/:tenant/*"}, mid.WeChatAuth, http.Wechat.Render) 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 { engine.Get("/posters/:tenant/:hash.jpg", func(c fiber.Ctx) error {
tenant := c.Params("tenant") tenant := c.Params("tenant")
hash := c.Params("hash") hash := c.Params("hash")