...
|
...
|
@@ -27,9 +27,8 @@ const model = { |
|
|
offset: 0,
|
|
|
limit: 3
|
|
|
}, params));
|
|
|
const base = yield serviceAPI.get('guang/api/v2/article/getArticleBaseInfo', params);
|
|
|
|
|
|
return camelCase([article, content, brands, other, base]);
|
|
|
return camelCase([article, content, brands, other]);
|
|
|
})();
|
|
|
},
|
|
|
|
...
|
...
|
@@ -41,11 +40,21 @@ const model = { |
|
|
* @returns {*}
|
|
|
*/
|
|
|
like(params, flag) {
|
|
|
if (flag) {
|
|
|
return serviceAPI.get('guang/api/v2/praise/setPraise', params);
|
|
|
} else {
|
|
|
return serviceAPI.get('guang/api/v2/praise/cancel', params);
|
|
|
}
|
|
|
return Promise.coroutine(function*() {
|
|
|
let ret = null;
|
|
|
|
|
|
if (flag) {
|
|
|
ret = yield serviceAPI.get('guang/api/v2/praise/setPraise', params);
|
|
|
} else {
|
|
|
ret = yield serviceAPI.get('guang/api/v2/praise/cancel', params);
|
|
|
}
|
|
|
|
|
|
const misc = yield serviceAPI.get('guang/api/v2/article/getArticleBaseInfo', Object.assign({
|
|
|
id: params.article_id
|
|
|
}, params));
|
|
|
|
|
|
return [ret, misc];
|
|
|
})();
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -56,11 +65,32 @@ const model = { |
|
|
* @returns {*}
|
|
|
*/
|
|
|
favorite(params, flag) {
|
|
|
if (flag) {
|
|
|
return serviceAPI.get('guang/api/v1/favorite/setFavorite', params);
|
|
|
} else {
|
|
|
return serviceAPI.get('guang/api/v1/favorite/cancelFavorite', params);
|
|
|
}
|
|
|
return Promise.coroutine(function*() {
|
|
|
let ret = null;
|
|
|
|
|
|
if (flag) {
|
|
|
ret = yield serviceAPI.get('guang/api/v1/favorite/setFavorite', params);
|
|
|
} else {
|
|
|
ret = yield serviceAPI.get('guang/api/v1/favorite/cancelFavorite', params);
|
|
|
}
|
|
|
|
|
|
const misc = yield serviceAPI.get('guang/api/v2/article/getArticleBaseInfo', Object.assign({
|
|
|
id: params.article_id
|
|
|
}, params));
|
|
|
|
|
|
return [ret, misc];
|
|
|
})();
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 其它信息
|
|
|
*
|
|
|
* @param params
|
|
|
*/
|
|
|
misc(params) {
|
|
|
return serviceAPI.get('guang/api/v2/article/getArticleBaseInfo', Object.assign({
|
|
|
id: params.article_id
|
|
|
}, params));
|
|
|
}
|
|
|
};
|
|
|
|
...
|
...
|
|