From 2b327cd36535d0bcaebc6a91a93a6049724e39c2 Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Mon, 15 Jun 2026 17:52:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(backend):=20=E4=BF=AE=E5=A4=8D=20/app/produ?= =?UTF-8?q?ct/=20=E5=88=86=E4=BA=AB=E6=97=A0=20OG=20=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=EF=BC=8C=E6=8F=8F=E8=BF=B0=E5=88=86=E4=B8=A4=E8=A1=8C=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- CHANGELOG.md | 6 ++++++ backend/internal/handler/public.go | 2 +- deploy/nginx-jiu.conf | 10 ++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b3b916..157fde3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.0.48] - 2026-06-15 + +### 修复 +- 修复分享 `/app/product/` 路径时微信爬虫拿不到 OG 标签的问题(nginx 补充该路径的代理规则) +- 分享卡片描述规格/系列与门店名分两行显示 + ## [1.0.47] - 2026-06-15 ### 修复 diff --git a/backend/internal/handler/public.go b/backend/internal/handler/public.go index 83a6a0f..86f690e 100644 --- a/backend/internal/handler/public.go +++ b/backend/internal/handler/public.go @@ -357,7 +357,7 @@ func buildProductOG(product model.Product, shopName, publicURL string) string { suffix = shopName + suffix } if desc != "" { - desc = desc + " | " + suffix + desc = desc + "\n" + suffix } else { desc = suffix } diff --git a/deploy/nginx-jiu.conf b/deploy/nginx-jiu.conf index 064f7de..5f5d245 100644 --- a/deploy/nginx-jiu.conf +++ b/deploy/nginx-jiu.conf @@ -55,6 +55,16 @@ server { proxy_read_timeout 30s; } + # Flutter 路由会把 /product/:id 重写为 /app/product/:id(base-href=/app/) + # 分享此 URL 时微信爬虫也需要 OG 标签 → 去掉 /app 前缀后转发后端 + location ~ ^/app/product/ { + rewrite ^/app(/product/.+)$ $1 break; + proxy_pass http://127.0.0.1:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_read_timeout 30s; + } + # 桌面客户端安装包下载(Windows .exe / macOS .zip) location /downloads/ { alias /opt/jiu/downloads/;