Authored by 郝肖肖

Merge branch 'feature/newBindMobile' into 'release/6.5'

code-check



See merge request !1240
... ... @@ -84,7 +84,6 @@ router.get('/passport/password/resetsuccess', reset.passwordResetOkPage); // 重
// 通过邮箱登录绑定手机号
router.get('/passport/bind/forceBindMobile', validateCode.load, bind.forceBindMobilePage);
router.post('/passport/bind/forceSendMsg',
validateCode.check,
bind.isCheckEmailPassword,
bind.sendMsgApi,
bind.forceSendMsg
... ... @@ -98,7 +97,7 @@ router.post('/passport/bind/continueMobile', bind.isCheckEmailPassword, bind.for
// 第三方绑定手机号
router.get('/passport/bind/index', validateCode.load, bind.thirdBindMobilePage);
router.post('/passport/bind/thirdSendMsg', validateCode.check, bind.thirdSendMsgApi, bind.forceSendMsg);
router.post('/passport/bind/thirdSendMsg', bind.thirdSendMsgApi, bind.forceSendMsg);
router.post('/passport/bind/thirdMobileCheck',
bind.changeMobileCheckApi,
bind.thirdBindMobileApi
... ...
<div class="passport-bind-page">
<div class="safety-tip">
<i for="verifyCode" class="iconfont">&#xe71c;</i>
<i class="safety-tip-icon"></i>
您的账户存在安全风险,建议您绑定手机号码提升安全级别
</div>
... ...
... ... @@ -2,17 +2,9 @@ import $ from 'yoho-jquery';
import tip from 'plugin/tip';
import Page from 'yoho-page';
import api from '../api';
import Validate from 'plugin/validata';
import dialog from 'plugin/dialog';
import bindDialogHbs from 'passport/bind-dialog-tip.hbs';
const $captcha = $('#js-img-check');
const validate = new Validate($captcha, {
useREM: {
rootFontSize: 40,
picWidth: 150
}
});
const showErrTip = tip.show;
class EmailBindMobile extends Page {
... ... @@ -33,10 +25,6 @@ class EmailBindMobile extends Page {
}
init() {
if ($captcha.data('userverify')) {
validate.init();
}
this.bindEvents();
}
... ... @@ -126,7 +114,6 @@ class EmailBindMobile extends Page {
}, 1000);
}
/**
* 获取验证码
*/
... ... @@ -147,34 +134,27 @@ class EmailBindMobile extends Page {
this.selector.verifyCodeBtn.data('oneClick', true);
validate.getResults().then(result => {
let params = {
area: area.replace('+', ''),
mobile: pn
};
$.extend(params, result);
let params = {
area: area.replace('+', ''),
mobile: pn
};
this.ajax({
url: '/passport/bind/forceSendMsg',
type: 'POST',
data: params
}).then(codeResult => {
this.selector.verifyCodeBtn.data('oneClick', false);
validate.type === 2 && validate.refresh();
if (codeResult.code === 200) {
this.countDown();
return;
} else {
showErrTip(codeResult.message);
}
this.ajax({
url: '/passport/bind/forceSendMsg',
type: 'POST',
data: params
}).then(codeResult => {
this.selector.verifyCodeBtn.data('oneClick', false);
(codeResult.changeCaptcha && validate.type !== 2) && validate.refresh();
}).catch(() => {
this.selector.verifyCodeBtn.data('oneClick', false);
showErrTip('出错了,请重试');
validate.refresh();
});
if (codeResult.code === 200) {
this.countDown();
return;
} else {
showErrTip(codeResult.message);
}
}).catch(() => {
this.selector.verifyCodeBtn.data('oneClick', false);
showErrTip('出错了,请重试');
});
}
... ...
... ... @@ -2,17 +2,9 @@ import $ from 'yoho-jquery';
import tip from 'plugin/tip';
import Page from 'yoho-page';
import api from '../api';
import Validate from 'plugin/validata';
import dialog from 'plugin/dialog';
import bindDialogHbs from 'passport/bind-dialog-tip.hbs';
const $captcha = $('#js-img-check');
const validate = new Validate($captcha, {
useREM: {
rootFontSize: 40,
picWidth: 150
}
});
const showErrTip = tip.show;
class ThirdBindMobile extends Page {
... ... @@ -35,10 +27,6 @@ class ThirdBindMobile extends Page {
}
init() {
if ($captcha.data('userverify')) {
validate.init();
}
this.bindEvents();
}
... ... @@ -149,34 +137,27 @@ class ThirdBindMobile extends Page {
this.selector.verifyCodeBtn.data('oneClick', true);
validate.getResults().then(result => {
let params = {
area: area.replace('+', ''),
mobile: pn
};
$.extend(params, result);
let params = {
area: area.replace('+', ''),
mobile: pn
};
this.ajax({
url: '/passport/bind/thirdSendMsg',
type: 'POST',
data: params
}).then(codeResult => {
this.selector.verifyCodeBtn.data('oneClick', false);
validate.type === 2 && validate.refresh();
if (codeResult.code === 200) {
this.countDown();
return;
} else {
showErrTip(codeResult.message);
}
this.ajax({
url: '/passport/bind/thirdSendMsg',
type: 'POST',
data: params
}).then(codeResult => {
this.selector.verifyCodeBtn.data('oneClick', false);
(codeResult.changeCaptcha && validate.type !== 2) && validate.refresh();
}).catch(() => {
this.selector.verifyCodeBtn.data('oneClick', false);
showErrTip('出错了,请重试');
validate.refresh();
});
if (codeResult.code === 200) {
this.countDown();
return;
} else {
showErrTip(codeResult.message);
}
}).catch(() => {
this.selector.verifyCodeBtn.data('oneClick', false);
showErrTip('出错了,请重试');
});
}
... ...
... ... @@ -12,6 +12,16 @@
color: #fff;
opacity: 0.8;
}
.safety-tip-icon {
width: 22px;
height: 30px;
background-image: url("/passport/safety-icon.png");
background-repeat: no-repeat;
background-size: contain;
display: inline-block;
vertical-align: sub;
}
}
.s-dialog-bind {
... ...