Authored by 周少峰

Merge branch 'hotfix/reg-add-code'

... ... @@ -266,7 +266,7 @@ let mobileRegister = (req, res, next) => {
}
/* 手机注册: 调用注册接口*/
let regResult = yield regService.regMobileAes(area, mobile, password, cookie.getShoppingKey(req));
let regResult = yield regService.regMobileAes(area, mobile, password, code, cookie.getShoppingKey(req));
if (!regResult.code || regResult.code !== 200) {
data.message = '注册失败';
... ...
... ... @@ -40,7 +40,8 @@ const syncUserSession = (uid, req, res, sessionKey) => {
let encryptionUid = aes.encryptionUid(data.uid);
if (data) {
let uidCookie = `${data.profile_name}::${encryptionUid}::${data.vip_info.title}::${token}`;
let uidCookie =
`${encodeURIComponent(data.profile_name)}::${encryptionUid}::${data.vip_info.title}::${token}`;
let isStudent = data.vip_info.is_student || 0;
res.cookie('_UID', uidCookie, {
... ...
... ... @@ -30,27 +30,13 @@ let validMobileCode = (area, mobile, code) => {
return api.post('', params);
};
let regMobile = (area, mobile, password, shoppingKey)=> {
let params = {
method: 'app.passport.register',
area: area,
profile: mobile,
password: password
};
if (shoppingKey) {
params.shopping_key = shoppingKey;
}
return api.post('', params);
};
let regMobileAes = (area, mobile, password, shoppingKey)=> {
let regMobileAes = (area, mobile, password, code, shoppingKey)=> {
let params = {
method: 'app.passport.registerAES',
area: area,
profile: mobile,
password: aes.aesPwd(password)
password: aes.aesPwd(password),
verifyCode: code
};
if (shoppingKey) {
... ... @@ -63,6 +49,5 @@ let regMobileAes = (area, mobile, password, shoppingKey)=> {
module.exports = {
sendCodeToMobile,
validMobileCode,
regMobile,
regMobileAes
};
... ...
... ... @@ -174,7 +174,7 @@
<input id="country-code-hide" name="countryCode" type="hidden" value="{{countryCode}}">
<input id="captcha-sms-token-hide" name="token" type="hidden">
<input id="qrcode" name="qrcode" type="hidden" value="//m.yohobuy.com/signin.html">
<input id="qrcode" name="qrcode" type="hidden" value="http://m.yohobuy.com/signin.html">
<input id="uid" type="hidden">
</div>
... ...
{
"name": "yohobuy-node",
"version": "5.2.3",
"version": "5.2.4",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -81,7 +81,7 @@ function getProfileName() {
return 0;
}
return user[0];
return decodeURIComponent(user[0]);
}
function getShoppingKey() {
... ...
... ... @@ -1196,8 +1196,6 @@ $deviceSwitcher.on('click', function() {
refreshQrCodeAsync().then(pollingThisQrCodeStatusAsync);
}
// 临时去掉二维码登陆
$(this).parent('.switch-login-type').hide();
});
// 鼠标移动到二维码上面
... ...
... ... @@ -76,8 +76,8 @@ function setLoginStatus(data) {
'<a href="//www.yohobuy.com/logout.html">[退出]</a>';
} else {
loginHtml = '<span>Hi~</span>&nbsp;' +
'<a href="//www.yohobuy.com/signin.html?refer="' + window.location.href + '>[请登录]</a>&nbsp;' +
'<a href="//www.yohobuy.com/reg.html"' + window.location.href + '>[免费注册]</a>';
'<a href="//www.yohobuy.com/signin.html">[请登录]</a>&nbsp;' +
'<a href="//www.yohobuy.com/reg.html">[免费注册]</a>';
}
$('.header-tool li').eq(0).html(loginHtml);
}
... ...