Authored by 王水玲

星潮教室

... ... @@ -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);
... ...
... ... @@ -13,8 +13,8 @@ module.exports = {
port: 6001,
siteUrl: '//m.yohobuy.com',
domains: {
api: 'http://api.yoho.yohoops.org/',
service: 'http://service.yoho.yohoops.org/'
api: 'http://testapi.yoho.cn:28078/',
service: 'http://testservice.yoho.cn:28077/'
},
useOneapm: false,
useCache: false,
... ...