|
@@ -346,9 +346,12 @@ const bind = { |
|
@@ -346,9 +346,12 @@ const bind = { |
346
|
|
346
|
|
347
|
// 第三方绑定手机号发送短信
|
347
|
// 第三方绑定手机号发送短信
|
348
|
thirdSendMsgApi: (req, res, next) => {
|
348
|
thirdSendMsgApi: (req, res, next) => {
|
349
|
- req.ctx(BindServiceModel).sendThirdBindMobileCodeOnly(Object.assign({}, req.body, {
|
349
|
+ let params = {
|
|
|
350
|
+ from: req.cookies.from || 'yohobuy',
|
350
|
superCapture: req.body.geetest_challenge ? config.superCapture : ''
|
351
|
superCapture: req.body.geetest_challenge ? config.superCapture : ''
|
351
|
- })).then(result => {
|
352
|
+ };
|
|
|
353
|
+
|
|
|
354
|
+ req.ctx(BindServiceModel).sendThirdBindMobileCodeOnly(Object.assign({}, req.body, params)).then(result => {
|
352
|
if (_.get(result, 'code', 400) === 200) {
|
355
|
if (_.get(result, 'code', 400) === 200) {
|
353
|
return next();
|
356
|
return next();
|
354
|
}
|
357
|
}
|
|
@@ -362,7 +365,11 @@ const bind = { |
|
@@ -362,7 +365,11 @@ const bind = { |
362
|
return res.json({code: 401, data: {}, message: '请重新登录授权'});
|
365
|
return res.json({code: 401, data: {}, message: '请重新登录授权'});
|
363
|
}
|
366
|
}
|
364
|
|
367
|
|
365
|
- req.ctx(BindServiceModel).thirdBindMobile(req.body).then(result => {
|
368
|
+ let params = {
|
|
|
369
|
+ from: req.cookies.from || 'yohobuy'
|
|
|
370
|
+ };
|
|
|
371
|
+
|
|
|
372
|
+ req.ctx(BindServiceModel).thirdBindMobile(Object.assign({}, req.body, params)).then(result => {
|
366
|
if (_.get(result, 'code', 400) !== 200) {
|
373
|
if (_.get(result, 'code', 400) !== 200) {
|
367
|
return res.json(result);
|
374
|
return res.json(result);
|
368
|
}
|
375
|
}
|
|
@@ -380,9 +387,12 @@ const bind = { |
|
@@ -380,9 +387,12 @@ const bind = { |
380
|
|
387
|
|
381
|
// 通过邮箱绑定手机号发送短信
|
388
|
// 通过邮箱绑定手机号发送短信
|
382
|
sendMsgApi: (req, res, next) => {
|
389
|
sendMsgApi: (req, res, next) => {
|
383
|
- req.ctx(BindServiceModel).sendChangeBindMobileCodeOnly(Object.assign({}, req.body, {
|
390
|
+ let params = {
|
|
|
391
|
+ from: req.cookies.from || 'yohobuy',
|
384
|
superCapture: req.body.geetest_challenge ? config.superCapture : ''
|
392
|
superCapture: req.body.geetest_challenge ? config.superCapture : ''
|
385
|
- })).then(result => {
|
393
|
+ };
|
|
|
394
|
+
|
|
|
395
|
+ req.ctx(BindServiceModel).sendChangeBindMobileCodeOnly(Object.assign({}, req.body, params)).then(result => {
|
386
|
if (_.get(result, 'code', 400) === 200) {
|
396
|
if (_.get(result, 'code', 400) === 200) {
|
387
|
return next();
|
397
|
return next();
|
388
|
}
|
398
|
}
|
|
@@ -392,7 +402,12 @@ const bind = { |
|
@@ -392,7 +402,12 @@ const bind = { |
392
|
|
402
|
|
393
|
// 检查手机是否绑定
|
403
|
// 检查手机是否绑定
|
394
|
changeMobileCheckApi: (req, res, next) => {
|
404
|
changeMobileCheckApi: (req, res, next) => {
|
395
|
- req.ctx(BindServiceModel).changeMobileCheck(req.body).then(result => {
|
405
|
+ let params = {
|
|
|
406
|
+ from: req.cookies.from || 'yohobuy',
|
|
|
407
|
+ superCapture: req.body.geetest_challenge ? config.superCapture : ''
|
|
|
408
|
+ };
|
|
|
409
|
+
|
|
|
410
|
+ req.ctx(BindServiceModel).changeMobileCheck(Object.assign({}, req.body, params)).then(result => {
|
396
|
if (_.get(result, 'data.isBind', '') === 'N' &&
|
411
|
if (_.get(result, 'data.isBind', '') === 'N' &&
|
397
|
_.get(result, 'data.isRegister', '') === 'N') {
|
412
|
_.get(result, 'data.isRegister', '') === 'N') {
|
398
|
return next();
|
413
|
return next();
|
|
@@ -437,10 +452,13 @@ const bind = { |
|
@@ -437,10 +452,13 @@ const bind = { |
437
|
|
452
|
|
438
|
// 调用绑定接口
|
453
|
// 调用绑定接口
|
439
|
forceBindMobileApi: (req, res, next) => {
|
454
|
forceBindMobileApi: (req, res, next) => {
|
440
|
- req.ctx(BindServiceModel).bindEmailLoginMobile(Object.assign(req.body, {
|
455
|
+ let params = {
|
441
|
email: req.session.bindEmail,
|
456
|
email: req.session.bindEmail,
|
442
|
password: req.session.bindPassword,
|
457
|
password: req.session.bindPassword,
|
443
|
- })).then(result => {
|
458
|
+ from: req.cookies.from || 'yohobuy',
|
|
|
459
|
+ };
|
|
|
460
|
+
|
|
|
461
|
+ req.ctx(BindServiceModel).bindEmailLoginMobile(Object.assign({}, req.body, params)).then(result => {
|
444
|
if (_.get(result, 'code', 400) !== 200) {
|
462
|
if (_.get(result, 'code', 400) !== 200) {
|
445
|
return res.json(result);
|
463
|
return res.json(result);
|
446
|
}
|
464
|
}
|