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}}