Authored by ccbikai(👎🏻🍜)

短信验证码快捷登录,自动注册

... ... @@ -388,7 +388,7 @@ exports.password = (req, res, next) => {
let mobile = _.get(req.session, 'smsLogin.mobile');
let area = _.get(req.session, 'smsLogin.area');
let password = (req.body.password || '').trim();
let registerCode = +req.body.registerCode || 0;
let registerCode = req.body.registerCode || '';
if (!password) {
data.message = PASSWORD_REQUIRED;
... ...
... ... @@ -146,13 +146,14 @@ page = {
checkPoint('YB_MOBILE_LOGIN_C'); // 埋点
if (res.newer) {
//res.redirect = res.redirect + '&registerCode=' + res.registerCode;
res.redirect = res.redirect + '&registerCode=' + res.registerCode;
// 暂时跳注册 TODO
tip.show('请先注册!');
setTimeout(function(){
location.href = '//m.yohobuy.com/reg.html';
}, 2000);
return;
// tip.show('请先注册!');
// setTimeout(function(){
// location.href = '//m.yohobuy.com/reg.html';
// }, 2000);
// return;
}
location.href = res.redirect;
... ...
... ... @@ -20,7 +20,7 @@ setTimeout(function() {
}, 3000);
page = {
smsCode: window.queryString.smsCode,
registerCode: window.queryString.registerCode,
init: function() {
this.domInit();
this.bindEvent();
... ... @@ -40,7 +40,7 @@ page = {
});
$nextBtn.on('click', function() {
if (!self.smsCode) {
if (!self.registerCode) {
return tip.show('非法请求');
}
self.setPasswordAndLogin();
... ... @@ -82,7 +82,7 @@ page = {
$nextBtn.prop('disabled', true);
$.post('/passport/sms_login/password.json', {
password: password,
smsCode: self.smsCode
registerCode: self.registerCode
})
.done(function(res) {
if (res.code === 200) {
... ...