Authored by 姜枫

使用cookie中getRefer方法

... ... @@ -23,13 +23,7 @@ const SIGNIN_LEFT_BANNER_CODE = 'db350894e01e90eac55cd3a13ad77331';
// 第三方登录回调
function doPassportCallback(req, res, user) {
let shoppingKey = cookie.getShoppingKey(req);
let refer = req.cookies.refer;
if (refer) {
refer = decodeURI(req.cookies.refer);
} else {
refer = config.siteUrl;
}
let refer = cookie.getRefer(req, config.siteUrl);
if (/sign|login/.test(refer)) {
refer = config.siteUrl;
... ... @@ -77,6 +71,7 @@ const common = {
if (!refer) {
refer = req.get('Referer');
}
refer && res.cookie('refer', encodeURI(refer), {
domain: 'yohobuy.com'
});
... ...