...
|
...
|
@@ -146,24 +146,24 @@ exports.collocationList = (req, res, next) => { |
|
|
*/
|
|
|
exports.setFavorite = (req, res, next) => {
|
|
|
let uid = req.cookies.guangStarUid || 0;
|
|
|
let urlEncode = '';
|
|
|
let url = '';
|
|
|
let params = {
|
|
|
articleId: req.body.articleId,
|
|
|
type: req.body.type
|
|
|
};
|
|
|
|
|
|
if (req.body.pageType === '1') {
|
|
|
url = '/guang/star/collocation';
|
|
|
urlEncode = '\/guang\/star\/collocation';
|
|
|
} else {
|
|
|
url = `/guang/star/detail?tag=${req.body.tag}`;
|
|
|
urlEncode = '\/guang\/star\/detail';
|
|
|
}
|
|
|
|
|
|
starModel.setFavorite(params, uid).then((result) => {
|
|
|
if (result.code === 400) {
|
|
|
result.data = `${url}?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:\/\/m.yohobuy.com${urlEncode}","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"N"}}`; // eslint-disable-line
|
|
|
if (req.body.pageType === '1') {
|
|
|
let urlEncode = '\/guang\/star\/collocation';
|
|
|
let url = '/guang/star/collocation';
|
|
|
|
|
|
result.data = `${url}?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:\/\/m.yohobuy.com${urlEncode}","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"N"}}`; // eslint-disable-line
|
|
|
} else {
|
|
|
let urlEncode = '\/guang\/star\/detail';
|
|
|
let url = `/guang/star/detail?tag=${req.body.tag}`;
|
|
|
|
|
|
result.data = `${url}&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:\/\/m.yohobuy.com${urlEncode}","param":{"from":"app","tag":"${req.body.tag}"}},"requesturl":{"url":"","param":{}},"priority":"N"}}`; // eslint-disable-line
|
|
|
}
|
|
|
}
|
|
|
res.json(result);
|
|
|
}).catch(next);
|
...
|
...
|
|