Merge branch 'feature/force-bind2' into release/6.5
Showing
4 changed files
with
19 additions
and
7 deletions
@@ -73,7 +73,7 @@ const cert = { | @@ -73,7 +73,7 @@ const cert = { | ||
73 | return res.json({code: 400, message: '', data: ''}); | 73 | return res.json({code: 400, message: '', data: ''}); |
74 | } | 74 | } |
75 | 75 | ||
76 | - req.ctx(CertService).certCheck(mobile, area, code).then(({error, result}) => { | 76 | + req.ctx(CertService).certCheck(mobile, area, code, req.body).then(({error, result}) => { |
77 | if (error) { | 77 | if (error) { |
78 | return res.json({code: 400, message: '短信验证码不正确', data: ''}); | 78 | return res.json({code: 400, message: '短信验证码不正确', data: ''}); |
79 | } | 79 | } |
@@ -9,7 +9,7 @@ module.exports = class extends global.yoho.BaseModel { | @@ -9,7 +9,7 @@ module.exports = class extends global.yoho.BaseModel { | ||
9 | super(ctx); | 9 | super(ctx); |
10 | } | 10 | } |
11 | 11 | ||
12 | - certCheck(mobile, area, code) { | 12 | + certCheck(mobile, area, code, extra) { |
13 | let params = { | 13 | let params = { |
14 | method: 'app.bind.changeMobileCheck', | 14 | method: 'app.bind.changeMobileCheck', |
15 | area: area, | 15 | area: area, |
@@ -17,6 +17,13 @@ module.exports = class extends global.yoho.BaseModel { | @@ -17,6 +17,13 @@ module.exports = class extends global.yoho.BaseModel { | ||
17 | code: code | 17 | code: code |
18 | }; | 18 | }; |
19 | 19 | ||
20 | + if (extra.openId && extra.sourceType) { | ||
21 | + Object.assign(params, { | ||
22 | + open_id: extra.openId, | ||
23 | + source_type: extra.sourceType | ||
24 | + }); | ||
25 | + } | ||
26 | + | ||
20 | return this.get({data: params}); | 27 | return this.get({data: params}); |
21 | } | 28 | } |
22 | 29 |
@@ -11,8 +11,8 @@ module.exports = class extends global.yoho.BaseModel { | @@ -11,8 +11,8 @@ module.exports = class extends global.yoho.BaseModel { | ||
11 | this.certMobile = this.api.certMobile.bind(this.api); | 11 | this.certMobile = this.api.certMobile.bind(this.api); |
12 | } | 12 | } |
13 | 13 | ||
14 | - async certCheck(mobile, area, smsCode) { | ||
15 | - let {code, data} = await this.api.certCheck(mobile, area, smsCode); | 14 | + async certCheck(mobile, area, smsCode, extra) { |
15 | + let {code, data} = await this.api.certCheck(mobile, area, smsCode, extra); | ||
16 | 16 | ||
17 | if (!code || code !== 200) { | 17 | if (!code || code !== 200) { |
18 | return { | 18 | return { |
@@ -15,6 +15,9 @@ var $wrapper = $('.bindwrapper'), | @@ -15,6 +15,9 @@ var $wrapper = $('.bindwrapper'), | ||
15 | $phoneTip = $wrapper.find('.phone-err-tip'), | 15 | $phoneTip = $wrapper.find('.phone-err-tip'), |
16 | $nextBtn = $wrapper.find('.yohobindbtn'); | 16 | $nextBtn = $wrapper.find('.yohobindbtn'); |
17 | 17 | ||
18 | +var thirdOpenId = $('#openId').val(), | ||
19 | + thirdSourceType = $('#sourceType').val(); | ||
20 | + | ||
18 | var Alert = require('../../common/dialog').Alert; | 21 | var Alert = require('../../common/dialog').Alert; |
19 | var dialog = require('../cert/dialog'); | 22 | var dialog = require('../cert/dialog'); |
20 | 23 | ||
@@ -180,8 +183,8 @@ function actionSubmit() { | @@ -180,8 +183,8 @@ function actionSubmit() { | ||
180 | url: '/passport/autouserinfo/bindMobile', | 183 | url: '/passport/autouserinfo/bindMobile', |
181 | data: { | 184 | data: { |
182 | area: $('#areacode').val(), | 185 | area: $('#areacode').val(), |
183 | - openId: $('#openId').val(), | ||
184 | - sourceType: $('#sourceType').val(), | 186 | + openId: thirdOpenId, |
187 | + sourceType: thirdSourceType, | ||
185 | nickName: $('#nickName').val(), | 188 | nickName: $('#nickName').val(), |
186 | mobile: $('#mobile').val(), | 189 | mobile: $('#mobile').val(), |
187 | code: $('#smscode').val() | 190 | code: $('#smscode').val() |
@@ -242,7 +245,9 @@ function nextStep() { | @@ -242,7 +245,9 @@ function nextStep() { | ||
242 | data: { | 245 | data: { |
243 | mobile: mobile, | 246 | mobile: mobile, |
244 | area: areaCode, | 247 | area: areaCode, |
245 | - code: smsCode | 248 | + code: smsCode, |
249 | + openId: thirdOpenId, | ||
250 | + sourceType: thirdSourceType | ||
246 | }, | 251 | }, |
247 | dataType: 'json', | 252 | dataType: 'json', |
248 | success: function(data) { | 253 | success: function(data) { |
-
Please register or login to post a comment