Merge branch 'feature/loginfrom' into 'release/6.1'
bind-from See merge request !917
Showing
2 changed files
with
6 additions
and
3 deletions
@@ -216,11 +216,12 @@ const bind = { | @@ -216,11 +216,12 @@ const bind = { | ||
216 | let sourceType = req.body.sourceType; | 216 | let sourceType = req.body.sourceType; |
217 | let code = req.body.code; | 217 | let code = req.body.code; |
218 | let password = req.body.password || ''; | 218 | let password = req.body.password || ''; |
219 | + let from = req.cookies.from || 'yohobuy'; | ||
219 | 220 | ||
220 | if (_.isNumber(parseInt(phoneNum, 0)) && openId && sourceType && areaCode && code) { | 221 | if (_.isNumber(parseInt(phoneNum, 0)) && openId && sourceType && areaCode && code) { |
221 | BindService.checkBindCode(areaCode, phoneNum, code).then(result => { | 222 | BindService.checkBindCode(areaCode, phoneNum, code).then(result => { |
222 | if (result && result.code && result.code === 200) { | 223 | if (result && result.code && result.code === 200) { |
223 | - return BindService.bindMobile(openId, sourceType, phoneNum, areaCode, password); | 224 | + return BindService.bindMobile(openId, sourceType, phoneNum, areaCode, password, from); |
224 | } else { | 225 | } else { |
225 | return { code: 400, message: '短信验证码错误', data: '' }; | 226 | return { code: 400, message: '短信验证码错误', data: '' }; |
226 | } | 227 | } |
@@ -8,6 +8,7 @@ | @@ -8,6 +8,7 @@ | ||
8 | 'use strict'; | 8 | 'use strict'; |
9 | 9 | ||
10 | const api = global.yoho.API; | 10 | const api = global.yoho.API; |
11 | +const FROM = require('../../../config/from'); | ||
11 | 12 | ||
12 | const BindService = { | 13 | const BindService = { |
13 | bindCheck(mobile, openId, sourceType, area) { | 14 | bindCheck(mobile, openId, sourceType, area) { |
@@ -38,13 +39,14 @@ const BindService = { | @@ -38,13 +39,14 @@ const BindService = { | ||
38 | code: code | 39 | code: code |
39 | }); | 40 | }); |
40 | }, | 41 | }, |
41 | - bindMobile(openId, sourceType, mobile, area, password, nickname) { | 42 | + bindMobile(openId, sourceType, mobile, area, password, nickname, from) { |
42 | let params = { | 43 | let params = { |
43 | method: 'app.passport.bind', | 44 | method: 'app.passport.bind', |
44 | mobile: mobile, | 45 | mobile: mobile, |
45 | open_id: openId, | 46 | open_id: openId, |
46 | source_type: sourceType, | 47 | source_type: sourceType, |
47 | - area: area | 48 | + area: area, |
49 | + business_line: FROM[from].business_line | ||
48 | }; | 50 | }; |
49 | 51 | ||
50 | if (password) { | 52 | if (password) { |
-
Please register or login to post a comment