Authored by 毕凯

Merge branch 'feature/loginfrom' into 'release/6.1'

bind-from



See merge request !917
... ... @@ -216,11 +216,12 @@ const bind = {
let sourceType = req.body.sourceType;
let code = req.body.code;
let password = req.body.password || '';
let from = req.cookies.from || 'yohobuy';
if (_.isNumber(parseInt(phoneNum, 0)) && openId && sourceType && areaCode && code) {
BindService.checkBindCode(areaCode, phoneNum, code).then(result => {
if (result && result.code && result.code === 200) {
return BindService.bindMobile(openId, sourceType, phoneNum, areaCode, password);
return BindService.bindMobile(openId, sourceType, phoneNum, areaCode, password, from);
} else {
return { code: 400, message: '短信验证码错误', data: '' };
}
... ...
... ... @@ -8,6 +8,7 @@
'use strict';
const api = global.yoho.API;
const FROM = require('../../../config/from');
const BindService = {
bindCheck(mobile, openId, sourceType, area) {
... ... @@ -38,13 +39,14 @@ const BindService = {
code: code
});
},
bindMobile(openId, sourceType, mobile, area, password, nickname) {
bindMobile(openId, sourceType, mobile, area, password, nickname, from) {
let params = {
method: 'app.passport.bind',
mobile: mobile,
open_id: openId,
source_type: sourceType,
area: area
area: area,
business_line: FROM[from].business_line
};
if (password) {
... ...