Showing
1 changed file
with
21 additions
and
12 deletions
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | const _ = require('lodash'); | 3 | const _ = require('lodash'); |
4 | const moment = require('moment'); | 4 | const moment = require('moment'); |
5 | const camelCase = global.yoho.camelCase; | 5 | const camelCase = global.yoho.camelCase; |
6 | -const service = global.yoho.ServiceAPI; | 6 | +const serviceAPI = global.yoho.ServiceAPI; |
7 | const resourcesProcess = require(`${global.utils}/resources-process`); | 7 | const resourcesProcess = require(`${global.utils}/resources-process`); |
8 | const helpers = global.yoho.helpers; | 8 | const helpers = global.yoho.helpers; |
9 | const crypto = global.yoho.crypto; | 9 | const crypto = global.yoho.crypto; |
@@ -63,14 +63,18 @@ class familyModel extends global.yoho.BaseModel { | @@ -63,14 +63,18 @@ class familyModel extends global.yoho.BaseModel { | ||
63 | * 资源位 | 63 | * 资源位 |
64 | */ | 64 | */ |
65 | _getTrendPop(contentCode) { | 65 | _getTrendPop(contentCode) { |
66 | - return service.get('operations/api/v5/resource/get', { | ||
67 | - content_code: contentCode, | ||
68 | - }, { | ||
69 | - code: 200, | ||
70 | - cache: true | 66 | + return this.get({ |
67 | + api: serviceAPI, | ||
68 | + url: 'operations/api/v5/resource/get', | ||
69 | + data: { | ||
70 | + content_code: contentCode, | ||
71 | + }, | ||
72 | + param: { | ||
73 | + code: 200, | ||
74 | + cache: true | ||
75 | + } | ||
71 | }).then(result => { | 76 | }).then(result => { |
72 | if (result && result.code === 200 && result.data) { | 77 | if (result && result.code === 200 && result.data) { |
73 | - | ||
74 | return resourcesProcess(result.data); | 78 | return resourcesProcess(result.data); |
75 | } else { | 79 | } else { |
76 | return result; | 80 | return result; |
@@ -82,11 +86,16 @@ class familyModel extends global.yoho.BaseModel { | @@ -82,11 +86,16 @@ class familyModel extends global.yoho.BaseModel { | ||
82 | * 资源位 | 86 | * 资源位 |
83 | */ | 87 | */ |
84 | _getdownPop(param) { | 88 | _getdownPop(param) { |
85 | - return service.get('operations/api/v5/resource/get', { | ||
86 | - content_code: param.code, | ||
87 | - }, { | ||
88 | - code: 200, | ||
89 | - cache: true | 89 | + return this.get({ |
90 | + api: serviceAPI, | ||
91 | + url: 'operations/api/v5/resource/get', | ||
92 | + data: { | ||
93 | + content_code: param.code, | ||
94 | + }, | ||
95 | + param: { | ||
96 | + code: 200, | ||
97 | + cache: true | ||
98 | + } | ||
90 | }).then(result => { | 99 | }).then(result => { |
91 | if (result && result.code === 200 && result.data) { | 100 | if (result && result.code === 200 && result.data) { |
92 | 101 |
-
Please register or login to post a comment