Authored by 毕凯

Merge branch 'hotfix/baiduJsonLd' into 'gray'

jsonld



See merge request !1207
@@ -307,12 +307,12 @@ const index = (req, res, next) => { @@ -307,12 +307,12 @@ const index = (req, res, next) => {
307 isShare: isShare, 307 isShare: isShare,
308 id: id, 308 id: id,
309 showAnaJson: { 309 showAnaJson: {
310 - mipsite: true,  
311 - miptitle: data.title,  
312 - mipPublishTime: guang.detail.publishTime,  
313 - mipPic: mipPic,  
314 - mipDes: guang.shareDesc,  
315 - mipUrl: `${req.protocol}://m.yohobuy.com/guang/${id}.html` 310 + addBaiduSite: true,
  311 + title: data.title,
  312 + publishTime: guang.detail.publishTime,
  313 + pic: mipPic,
  314 + des: guang.shareDesc,
  315 + url: `${req.protocol}://m.yohobuy.com/guang/${id}.html`
316 } 316 }
317 }, data, parameter)); 317 }, data, parameter));
318 })().catch(next); 318 })().catch(next);
@@ -216,14 +216,12 @@ const detailIndex = (req, res, next) => { @@ -216,14 +216,12 @@ const detailIndex = (req, res, next) => {
216 currentHref: `https://m.yohobuy.com/guang/${id}.html` 216 currentHref: `https://m.yohobuy.com/guang/${id}.html`
217 }, 217 },
218 showAnaJson: { 218 showAnaJson: {
219 - mipsite: false,  
220 - miptitle: `${detail.getArticle.article_title} | Yoho!Buy有货 | 潮流购物逛不停`,  
221 - mipId: id,  
222 - mipPublishTime: mipPublishTime,  
223 - mipPic: mipPic,  
224 - mipDes: detail.getArticle.article_summary,  
225 - mipUrl: `${req.protocol}://m.yohobuy.com${req.originalUrl}`,  
226 - miphtml: `${req.protocol}://m.yohobuy.com/mip/guang/${id}.html` 219 + addBaiduSite: false,
  220 + title: `${detail.getArticle.article_title} | Yoho!Buy有货 | 潮流购物逛不停`,
  221 + publishTime: mipPublishTime,
  222 + pic: mipPic,
  223 + des: detail.getArticle.article_summary,
  224 + url: `${req.protocol}://m.yohobuy.com${req.originalUrl}`,
227 } 225 }
228 }, data)); 226 }, data));
229 })().catch(next); 227 })().catch(next);
@@ -85,12 +85,12 @@ const newDetail = { @@ -85,12 +85,12 @@ const newDetail = {
85 appPath: appPath, 85 appPath: appPath,
86 isMarsApp: req.yoho.isMarsApp, // 判断mars 86 isMarsApp: req.yoho.isMarsApp, // 判断mars
87 showAnaJson: { 87 showAnaJson: {
88 - mipsite: true,  
89 - miptitle: title,  
90 - mipPublishTime: moment.unix(result.shelveTime).format('YYYY-MM-DDTHH:mm:ss'), // mip日期必填  
91 - mipPic: mipPic,  
92 - mipDes: description,  
93 - mipUrl: `${req.protocol}://m.yohobuy.com/product/${result.productSkn}.html` 88 + addBaiduSite: true,
  89 + title: title,
  90 + publishTime: moment.unix(result.shelveTime).format('YYYY-MM-DDTHH:mm:ss'), // mip日期必填
  91 + pic: mipPic,
  92 + des: description,
  93 + url: `${req.protocol}://m.yohobuy.com/product/${result.productSkn}.html`
94 }, 94 },
95 miniPath: helpers.urlFormat('/api/wechat/miniapp.jpg', { 95 miniPath: helpers.urlFormat('/api/wechat/miniapp.jpg', {
96 miniapp_type: 0, 96 miniapp_type: 0,
@@ -22,8 +22,6 @@ @@ -22,8 +22,6 @@
22 <link rel="dns-prefetch" href="{{this}}"> 22 <link rel="dns-prefetch" href="{{this}}">
23 {{/dnsPrefetch.hosts}} 23 {{/dnsPrefetch.hosts}}
24 24
25 - {{> ld-json}}  
26 -  
27 <script> 25 <script>
28 {{#ifand isProduction wap.open.bughd}} 26 {{#ifand isProduction wap.open.bughd}}
29 window._timeStart = new Date().getTime(); 27 window._timeStart = new Date().getTime();
@@ -87,6 +85,8 @@ @@ -87,6 +85,8 @@
87 <link rel="apple-touch-startup-image" href="https://cdn.yoho.cn/h5/forios/startup/startup-orange-x.png" media="screen and (min-device-width: 751px) and (max-device-width: 1125px)"> 85 <link rel="apple-touch-startup-image" href="https://cdn.yoho.cn/h5/forios/startup/startup-orange-x.png" media="screen and (min-device-width: 751px) and (max-device-width: 1125px)">
88 <link rel="apple-touch-startup-image" href="https://cdn.yoho.cn/h5/forios/startup/startup-orange-6.png" media="screen and (min-device-width: 641px) and (max-device-width: 750px)"> 86 <link rel="apple-touch-startup-image" href="https://cdn.yoho.cn/h5/forios/startup/startup-orange-6.png" media="screen and (min-device-width: 641px) and (max-device-width: 750px)">
89 <link rel="apple-touch-startup-image" href="https://cdn.yoho.cn/h5/forios/startup/startup-orange-5.png" media="screen and (max-device-width: 640px)"> 87 <link rel="apple-touch-startup-image" href="https://cdn.yoho.cn/h5/forios/startup/startup-orange-5.png" media="screen and (max-device-width: 640px)">
  88 +
  89 + {{> ld-json}}
90 </head> 90 </head>
91 <body class="{{pageStyle}}{{#if isWechat}} wechat-body{{/if}}{{#if width750}} width750{{/if}}{{#if isPassportPage}} passport-body{{/if}}{{#if isStarIndexPage}} star-index-bg{{/if}}{{#if isStarDetailPage}} star-class-body{{/if}}{{#if isInstallmentPage}} installment-body{{/if}}{{#if @root.isMarsApp}} is-mars-app{{/if}}{{#if @root.isNowApp}} is-now-app{{/if}}"> 91 <body class="{{pageStyle}}{{#if isWechat}} wechat-body{{/if}}{{#if width750}} width750{{/if}}{{#if isPassportPage}} passport-body{{/if}}{{#if isStarIndexPage}} star-index-bg{{/if}}{{#if isStarDetailPage}} star-class-body{{/if}}{{#if isInstallmentPage}} installment-body{{/if}}{{#if @root.isMarsApp}} is-mars-app{{/if}}{{#if @root.isNowApp}} is-now-app{{/if}}">
92 <div class="main-wrap" id="main-wrap" {{#if appPath}}data-apppath='{{{appPath}}}'{{/if}} {{#if miniPath}}data-miniPath='{{{miniPath}}}'{{/if}}> 92 <div class="main-wrap" id="main-wrap" {{#if appPath}}data-apppath='{{{appPath}}}'{{/if}} {{#if miniPath}}data-miniPath='{{{miniPath}}}'{{/if}}>
1 {{# showAnaJson}} 1 {{# showAnaJson}}
2 -{{#if mipsite}}<script src="//msite.baidu.com/sdk/c.js?appid=1583402501013173"></script>{{/if}}  
3 <script type="application/ld+json"> 2 <script type="application/ld+json">
4 { 3 {
5 "@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld", 4 "@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld",
6 - "@id": "{{mipUrl}}", 5 + "@id": "{{url}}",
7 "appid": "1583402501013173", 6 "appid": "1583402501013173",
8 - "title": "{{miptitle}}", 7 + "title": "{{title}}",
9 "images": [ 8 "images": [
10 - {{#if mipPic}}"http:{{image mipPic 750 500 1}}"{{/if}} 9 + {{#if pic}}"http:{{image pic 750 500 1}}"{{/if}}
11 ], 10 ],
12 - "description": "{{mipDes}}",  
13 - "pubDate": "{{mipPublishTime}}" 11 + "description": "{{des}}",
  12 + "pubDate": "{{publishTime}}"
14 } 13 }
15 </script> 14 </script>
  15 +{{#if addBaiduSite}}<script src="//msite.baidu.com/sdk/c.js?appid=1583402501013173"></script>{{/if}}
16 {{/showAnaJson}} 16 {{/showAnaJson}}