Authored by yyq

Merge branch 'feature/force-bind2' into release/6.5

... ... @@ -73,7 +73,7 @@ const cert = {
return res.json({code: 400, message: '', data: ''});
}
req.ctx(CertService).certCheck(mobile, area, code).then(({error, result}) => {
req.ctx(CertService).certCheck(mobile, area, code, req.body).then(({error, result}) => {
if (error) {
return res.json({code: 400, message: '短信验证码不正确', data: ''});
}
... ...
... ... @@ -9,7 +9,7 @@ module.exports = class extends global.yoho.BaseModel {
super(ctx);
}
certCheck(mobile, area, code) {
certCheck(mobile, area, code, extra) {
let params = {
method: 'app.bind.changeMobileCheck',
area: area,
... ... @@ -17,6 +17,13 @@ module.exports = class extends global.yoho.BaseModel {
code: code
};
if (extra.openId && extra.sourceType) {
Object.assign(params, {
open_id: extra.openId,
source_type: extra.sourceType
});
}
return this.get({data: params});
}
... ...
... ... @@ -11,8 +11,8 @@ module.exports = class extends global.yoho.BaseModel {
this.certMobile = this.api.certMobile.bind(this.api);
}
async certCheck(mobile, area, smsCode) {
let {code, data} = await this.api.certCheck(mobile, area, smsCode);
async certCheck(mobile, area, smsCode, extra) {
let {code, data} = await this.api.certCheck(mobile, area, smsCode, extra);
if (!code || code !== 200) {
return {
... ...
... ... @@ -15,6 +15,9 @@ var $wrapper = $('.bindwrapper'),
$phoneTip = $wrapper.find('.phone-err-tip'),
$nextBtn = $wrapper.find('.yohobindbtn');
var thirdOpenId = $('#openId').val(),
thirdSourceType = $('#sourceType').val();
var Alert = require('../../common/dialog').Alert;
var dialog = require('../cert/dialog');
... ... @@ -180,8 +183,8 @@ function actionSubmit() {
url: '/passport/autouserinfo/bindMobile',
data: {
area: $('#areacode').val(),
openId: $('#openId').val(),
sourceType: $('#sourceType').val(),
openId: thirdOpenId,
sourceType: thirdSourceType,
nickName: $('#nickName').val(),
mobile: $('#mobile').val(),
code: $('#smscode').val()
... ... @@ -242,7 +245,9 @@ function nextStep() {
data: {
mobile: mobile,
area: areaCode,
code: smsCode
code: smsCode,
openId: thirdOpenId,
sourceType: thirdSourceType
},
dataType: 'json',
success: function(data) {
... ...