...
|
...
|
@@ -215,24 +215,26 @@ exports.getSearchRecommend = (params) => { |
|
|
|
|
|
if (result.code === 200) {
|
|
|
let resData = {
|
|
|
defaultTerms: [],
|
|
|
// defaultTerms: [],
|
|
|
hotTerms: [],
|
|
|
guessTerms: []
|
|
|
// guessTerms: []
|
|
|
};
|
|
|
|
|
|
resData.defaultTerms = _.map(result.data.defaultTerms, function(value) {
|
|
|
return {
|
|
|
href: helpers.urlFormat('', {query: value.url}, 'search'),
|
|
|
content: value.content,
|
|
|
sort: value.sort,
|
|
|
status: value.status,
|
|
|
type: value.type,
|
|
|
};
|
|
|
});
|
|
|
// resData.defaultTerms = _.map(result.data.defaultTerms, function(value) {
|
|
|
// return {
|
|
|
// href: helpers.urlFormat('', {query: value.url}, 'search'),
|
|
|
// content: value.content,
|
|
|
// sort: value.sort,
|
|
|
// status: value.status,
|
|
|
// type: value.type,
|
|
|
// };
|
|
|
// });
|
|
|
|
|
|
console.log(result.data.hotTerms);
|
|
|
|
|
|
resData.hotTerms = _.map(result.data.hotTerms, function(value) {
|
|
|
return {
|
|
|
href: helpers.urlFormat('', {query: value.url}, 'search'),
|
|
|
href: helpers.urlFormat('', {query: value.content}, 'search'),
|
|
|
content: value.content,
|
|
|
sort: value.sort,
|
|
|
status: value.status,
|
...
|
...
|
@@ -240,15 +242,15 @@ exports.getSearchRecommend = (params) => { |
|
|
};
|
|
|
});
|
|
|
|
|
|
resData.guessTerms = _.map(result.data.guessTerms, function(value) {
|
|
|
return {
|
|
|
href: helpers.urlFormat('', {query: value.url}, 'search'),
|
|
|
content: value.content,
|
|
|
sort: value.sort,
|
|
|
status: value.status,
|
|
|
type: value.type,
|
|
|
};
|
|
|
});
|
|
|
// resData.guessTerms = _.map(result.data.guessTerms, function(value) {
|
|
|
// return {
|
|
|
// href: helpers.urlFormat('', {query: value.url}, 'search'),
|
|
|
// content: value.content,
|
|
|
// sort: value.sort,
|
|
|
// status: value.status,
|
|
|
// type: value.type,
|
|
|
// };
|
|
|
// });
|
|
|
|
|
|
return resData;
|
|
|
}else{
|
...
|
...
|
|