Authored by htoooth

add encode

@@ -40,7 +40,7 @@ const syncUserSession = (uid, req, res, sessionKey) => { @@ -40,7 +40,7 @@ const syncUserSession = (uid, req, res, sessionKey) => {
40 let encryptionUid = aes.encryptionUid(data.uid); 40 let encryptionUid = aes.encryptionUid(data.uid);
41 41
42 if (data) { 42 if (data) {
43 - let uidCookie = `${data.profile_name}::${encryptionUid}::${data.vip_info.title}::${token}`; 43 + let uidCookie = `${encodeURIComponent(data.profile_name)}::${encryptionUid}::${data.vip_info.title}::${token}`;
44 let isStudent = data.vip_info.is_student || 0; 44 let isStudent = data.vip_info.is_student || 0;
45 45
46 res.cookie('_UID', uidCookie, { 46 res.cookie('_UID', uidCookie, {
@@ -81,7 +81,7 @@ function getProfileName() { @@ -81,7 +81,7 @@ function getProfileName() {
81 return 0; 81 return 0;
82 } 82 }
83 83
84 - return user[0]; 84 + return decodeURIComponent(user[0]);
85 } 85 }
86 86
87 function getShoppingKey() { 87 function getShoppingKey() {