fix(backend): 商品公开页移除「在 App 中查看」链接

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
This commit is contained in:
wangjia
2026-07-07 11:35:44 +08:00
parent f3efda3691
commit db9afb952c
3 changed files with 3 additions and 5 deletions
-2
View File
@@ -192,7 +192,6 @@ type productPageVM struct {
ShopAddr string ShopAddr string
ShopHours string ShopHours string
ShopWx string ShopWx string
AppURL string
} }
// ProductPage GET /product/:public_id // ProductPage GET /product/:public_id
@@ -235,7 +234,6 @@ func (h *PublicHandler) ProductPage(c *gin.Context) {
Origin: d.Origin, Origin: d.Origin,
ShelfLife: d.ShelfLife, ShelfLife: d.ShelfLife,
Storage: d.Storage, Storage: d.Storage,
AppURL: "/app/product/" + p.PublicID,
} }
for _, img := range p.Images { for _, img := range p.Images {
if img.URL != "" { if img.URL != "" {
+2 -2
View File
@@ -57,9 +57,9 @@ func TestProductPage_SSR(t *testing.T) {
// OG 标签(og:url 指向 SSR 短链) // OG 标签(og:url 指向 SSR 短链)
assert.Contains(t, body, `property="og:title"`) assert.Contains(t, body, `property="og:title"`)
assert.Contains(t, body, "/product/pub-ssr-001") assert.Contains(t, body, "/product/pub-ssr-001")
// 门店互跳 + App 兜底链接 // 门店互跳;「在 App 中查看」已移除(2026-07-07 用户拍板)
assert.Contains(t, body, "/shop/"+shop.Code) 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"} { for _, s := range []string{"cost", "purchase_price", "profit"} {
assert.NotContains(t, body, s, "公开页不得出现敏感字段名 %s", s) assert.NotContains(t, body, s, "公开页不得出现敏感字段名 %s", s)
@@ -187,7 +187,7 @@
{{end}} {{end}}
<footer class="foot"> <footer class="foot">
<div class="foot-rule"></div> <div class="foot-rule"></div>
<div>Powered by <a class="brand" href="https://jiu.51yanmei.com">岩美科技</a>{{if .AppURL}} · <a href="{{.AppURL}}">在 App 中查看</a>{{end}}</div> <div>Powered by <a class="brand" href="https://jiu.51yanmei.com">岩美科技</a></div>
<div class="icp"><a href="https://beian.miit.gov.cn" target="_blank" rel="noopener">京ICP备2026039814号</a></div> <div class="icp"><a href="https://beian.miit.gov.cn" target="_blank" rel="noopener">京ICP备2026039814号</a></div>
</footer> </footer>
</div> </div>