...
|
...
|
@@ -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);
|
|
|
}
|
...
|
...
|
|