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:
@@ -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 != "" {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
{{end}}
|
||||
<footer class="foot">
|
||||
<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>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user