Authored by 郭成尧

'cookie-crypt-self'

@@ -3,10 +3,14 @@ @@ -3,10 +3,14 @@
3 */ 3 */
4 'use strict'; 4 'use strict';
5 const helpers = global.yoho.helpers; 5 const helpers = global.yoho.helpers;
  6 +const crypto = global.yoho.crypto;
6 7
7 exports.index = (req, res) => { 8 exports.index = (req, res) => {
8 - res.cookie('_QYH_UNION', decodeURI(req.query._QYH_UNION), { 9 + let quhUnion = crypto.encryption('', decodeURI(req.query._QYH_UNION));
  10 +
  11 + res.cookie('_QYH_UNION', quhUnion, {
9 domain: 'yohobuy.com' 12 domain: 'yohobuy.com'
10 }); 13 });
  14 +
11 return res.redirect(req.query.target || helpers.urlFormat('/')); 15 return res.redirect(req.query.target || helpers.urlFormat('/'));
12 }; 16 };