Authored by 郝肖肖

'flx'

... ... @@ -346,9 +346,12 @@ const bind = {
// 第三方绑定手机号发送短信
thirdSendMsgApi: (req, res, next) => {
req.ctx(BindServiceModel).sendThirdBindMobileCodeOnly(Object.assign({}, req.body, {
let params = {
from: req.cookies.from || 'yohobuy',
superCapture: req.body.geetest_challenge ? config.superCapture : ''
})).then(result => {
};
req.ctx(BindServiceModel).sendThirdBindMobileCodeOnly(Object.assign({}, req.body, params)).then(result => {
if (_.get(result, 'code', 400) === 200) {
return next();
}
... ... @@ -362,7 +365,11 @@ const bind = {
return res.json({code: 401, data: {}, message: '请重新登录授权'});
}
req.ctx(BindServiceModel).thirdBindMobile(req.body).then(result => {
let params = {
from: req.cookies.from || 'yohobuy'
};
req.ctx(BindServiceModel).thirdBindMobile(Object.assign({}, req.body, params)).then(result => {
if (_.get(result, 'code', 400) !== 200) {
return res.json(result);
}
... ... @@ -380,9 +387,12 @@ const bind = {
// 通过邮箱绑定手机号发送短信
sendMsgApi: (req, res, next) => {
req.ctx(BindServiceModel).sendChangeBindMobileCodeOnly(Object.assign({}, req.body, {
let params = {
from: req.cookies.from || 'yohobuy',
superCapture: req.body.geetest_challenge ? config.superCapture : ''
})).then(result => {
};
req.ctx(BindServiceModel).sendChangeBindMobileCodeOnly(Object.assign({}, req.body, params)).then(result => {
if (_.get(result, 'code', 400) === 200) {
return next();
}
... ... @@ -392,7 +402,12 @@ const bind = {
// 检查手机是否绑定
changeMobileCheckApi: (req, res, next) => {
req.ctx(BindServiceModel).changeMobileCheck(req.body).then(result => {
let params = {
from: req.cookies.from || 'yohobuy',
superCapture: req.body.geetest_challenge ? config.superCapture : ''
};
req.ctx(BindServiceModel).changeMobileCheck(Object.assign({}, req.body, params)).then(result => {
if (_.get(result, 'data.isBind', '') === 'N' &&
_.get(result, 'data.isRegister', '') === 'N') {
return next();
... ... @@ -437,10 +452,13 @@ const bind = {
// 调用绑定接口
forceBindMobileApi: (req, res, next) => {
req.ctx(BindServiceModel).bindEmailLoginMobile(Object.assign(req.body, {
let params = {
email: req.session.bindEmail,
password: req.session.bindPassword,
})).then(result => {
from: req.cookies.from || 'yohobuy',
};
req.ctx(BindServiceModel).bindEmailLoginMobile(Object.assign({}, req.body, params)).then(result => {
if (_.get(result, 'code', 400) !== 200) {
return res.json(result);
}
... ...
... ... @@ -105,7 +105,7 @@ class BindServiceModel extends global.yoho.BaseModel {
sendChangeBindMobileCodeOnly(params) {
return this.get({data: {
method: 'app.bind.sendChangeBindMobileCodeOnlyImg',
business_line: 'yohobuy',
business_line: FROM[params.from].business_line,
mobile: params.mobile || '',
area: params.area || '86',
degrees: params.captcha || '',
... ... @@ -119,7 +119,7 @@ class BindServiceModel extends global.yoho.BaseModel {
return this.get({
data: Object.assign({
method: 'app.bind.changeMobileCheck',
business_line: 'yohobuy',
business_line: FROM[params.from].business_line,
}, params)
});
}
... ... @@ -128,7 +128,7 @@ class BindServiceModel extends global.yoho.BaseModel {
bindEmailLoginMobile(params) {
return this.get({data: {
method: 'app.bind.bindEmailLoginMobile',
business_line: 'yohobuy',
business_line: FROM[params.from].business_line,
mobile: params.mobile || '',
area: params.area || '86',
code: params.code,
... ... @@ -141,7 +141,7 @@ class BindServiceModel extends global.yoho.BaseModel {
sendThirdBindMobileCodeOnly(params) {
return this.get({data: {
method: 'app.bind.sendThirdBindMobileCodeOnlyImg',
business_line: 'yohobuy',
business_line: FROM[params.from].business_line,
mobile: params.mobile || '',
area: params.area || '86',
superCapture: params.superCapture || '',
... ... @@ -154,7 +154,7 @@ class BindServiceModel extends global.yoho.BaseModel {
thirdBindMobile(params) {
return this.get({data: {
method: 'app.bind.bindMobile',
business_line: 'yohobuy',
business_line: FROM[params.from].business_line,
mobile: params.mobile || '',
area: params.area || '86',
code: params.code,
... ...