...
|
...
|
@@ -7,6 +7,8 @@ const mysqlPromise = require('../../../lib/mysql-promise'); |
|
|
const config = require('../../../config/config');
|
|
|
const singleBrandKeyPre = config.singleBrandKeyPre;
|
|
|
const singleSortKeyPre = config.singleSortKeyPre;
|
|
|
const brandUrl = `${config.domains.search}brand/list.json`;
|
|
|
const sortUrl = `${config.domains.search}sortgroup.json`;
|
|
|
|
|
|
class seoModel extends model {
|
|
|
|
...
|
...
|
@@ -26,7 +28,7 @@ class seoModel extends model { |
|
|
if (!brands) {
|
|
|
|
|
|
// 调用接口
|
|
|
return this.get('http://192.168.102.216:8080/yohosearch/brand/list.json').then(res => {
|
|
|
return this.get(brandUrl).then(res => {
|
|
|
if (res) {
|
|
|
this.ctx.redis.setAsync(brandsRedisKey, JSON.stringify(res));
|
|
|
brands = res;
|
...
|
...
|
@@ -87,7 +89,7 @@ class seoModel extends model { |
|
|
if (!sorts) {
|
|
|
|
|
|
// 调用接口
|
|
|
return this.get('http://192.168.102.216:8080/yohosearch/sortgroup.json',{needAllSort:1, needSmallSort: 1}).then(res => {
|
|
|
return this.get(sortUrl,{needAllSort:1, needSmallSort: 1}).then(res => {
|
|
|
if (res) {
|
|
|
this.ctx.redis.setAsync(sortsRedisKey, JSON.stringify(res));
|
|
|
sorts = res;
|
...
|
...
|
|