From db9afb952cbd83019f3226ed290a25c1b2810959 Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Tue, 7 Jul 2026 11:35:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(backend):=20=E5=95=86=E5=93=81=E5=85=AC?= =?UTF-8?q?=E5=BC=80=E9=A1=B5=E7=A7=BB=E9=99=A4=E3=80=8C=E5=9C=A8=20App=20?= =?UTF-8?q?=E4=B8=AD=E6=9F=A5=E7=9C=8B=E3=80=8D=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o --- backend/internal/handler/public_page.go | 2 -- backend/internal/handler/public_page_test.go | 4 ++-- backend/internal/handler/templates/public_product.html | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/internal/handler/public_page.go b/backend/internal/handler/public_page.go index a71d99a..aa09f1a 100644 --- a/backend/internal/handler/public_page.go +++ b/backend/internal/handler/public_page.go @@ -192,7 +192,6 @@ type productPageVM struct { ShopAddr string ShopHours string ShopWx string - AppURL string } // ProductPage GET /product/:public_id @@ -235,7 +234,6 @@ func (h *PublicHandler) ProductPage(c *gin.Context) { Origin: d.Origin, ShelfLife: d.ShelfLife, Storage: d.Storage, - AppURL: "/app/product/" + p.PublicID, } for _, img := range p.Images { if img.URL != "" { diff --git a/backend/internal/handler/public_page_test.go b/backend/internal/handler/public_page_test.go index e5e1b23..cec0228 100644 --- a/backend/internal/handler/public_page_test.go +++ b/backend/internal/handler/public_page_test.go @@ -57,9 +57,9 @@ func TestProductPage_SSR(t *testing.T) { // OG 标签(og:url 指向 SSR 短链) assert.Contains(t, body, `property="og:title"`) assert.Contains(t, body, "/product/pub-ssr-001") - // 门店互跳 + App 兜底链接 + // 门店互跳;「在 App 中查看」已移除(2026-07-07 用户拍板) assert.Contains(t, body, "/shop/"+shop.Code) - assert.Contains(t, body, "/app/product/pub-ssr-001") + assert.NotContains(t, body, "/app/product/") // 敏感字段零暴露(成本/进价永不出现在公开页) for _, s := range []string{"cost", "purchase_price", "profit"} { assert.NotContains(t, body, s, "公开页不得出现敏感字段名 %s", s) diff --git a/backend/internal/handler/templates/public_product.html b/backend/internal/handler/templates/public_product.html index 489ec20..fa52dce 100644 --- a/backend/internal/handler/templates/public_product.html +++ b/backend/internal/handler/templates/public_product.html @@ -187,7 +187,7 @@ {{end}}