...
|
...
|
@@ -10,6 +10,7 @@ const goodsHbs = require(`${ROOT_PATH}/hbs/partials/seo/index.hbs`); |
|
|
const util = require(`${ROOT_PATH}/libs/util`);
|
|
|
const redis = require(`${ROOT_PATH}/libs/redis`);
|
|
|
const SIZE = 4000;
|
|
|
const GOODS_URL = 'http://spiderwebhook.yoho.cn/dist/goods-xml';
|
|
|
|
|
|
class SeoIndexModel extends global.yoho.BaseModel {
|
|
|
constructor(ctx) {
|
...
|
...
|
@@ -38,7 +39,8 @@ class SeoIndexModel extends global.yoho.BaseModel { |
|
|
|
|
|
result = [];
|
|
|
|
|
|
return {code: 200, data: `http://127.0.0.1:6005/dist/goods-xml/${fileName}`};
|
|
|
console.log(`${GOODS_URL}/${fileName} over...`);
|
|
|
return {code: 200, data: `${GOODS_URL}/${fileName}`};
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
@@ -63,7 +65,7 @@ class SeoIndexModel extends global.yoho.BaseModel { |
|
|
|
|
|
_.each(item.goods_list, goods => {
|
|
|
images.push({
|
|
|
contentUrl: helpers.image(goods.images_url, 450, 600),
|
|
|
contentUrl: `https:${helpers.image(goods.images_url, 450, 600)}`,
|
|
|
height: 600,
|
|
|
width: 450,
|
|
|
description: `${item.product_name}-${goods.color_name}`,
|
...
|
...
|
@@ -73,7 +75,7 @@ class SeoIndexModel extends global.yoho.BaseModel { |
|
|
});
|
|
|
|
|
|
products.push({
|
|
|
loc: `http://spiderwebhook.yoho.cn/dist/goods-xml/goods-${params.start}.xml`,
|
|
|
loc: `${GOODS_URL}/goods-${params.start}.xml`,
|
|
|
lastmod: moment.unix(item.edit_time).format('YYYY-MM-DD'),
|
|
|
changefreq: 'weekly',
|
|
|
priority: 1.0,
|
...
|
...
|
@@ -138,12 +140,12 @@ class SeoIndexModel extends global.yoho.BaseModel { |
|
|
|
|
|
searchList(params) {
|
|
|
params = _.assign({
|
|
|
limit: 60,
|
|
|
limit: 100,
|
|
|
method: 'app.search.li',
|
|
|
status: 1,
|
|
|
sales: 'Y',
|
|
|
stocknumber: 1,
|
|
|
method: 'app.search.li',
|
|
|
attribute_not: 2
|
|
|
attribute_not: 2,
|
|
|
udid: 'seo_format_data'
|
|
|
}, params);
|
|
|
|
|
|
return this.get({
|
...
|
...
|
|