ads.js
478 Bytes
/**
* Created by yoho on 2016/11/8.
*/
'use strict';
const helpers = global.yoho.helpers;
const crypto = global.yoho.crypto;
exports.index = (req, res) => {
let quhUnion = encodeURIComponent(crypto.encryption('', decodeURIComponent(req.query._QYH_UNION)));
res.cookie('_QYH_UNION', quhUnion, {
domain: 'yohobuy.com',
expires: new Date(Date.now() + 24 * 60 * 60 * 1000)
});
return res.redirect(req.query.target || helpers.urlFormat('/'));
};