Authored by 郝肖肖

'flx'

@@ -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 }
@@ -105,7 +105,7 @@ class BindServiceModel extends global.yoho.BaseModel { @@ -105,7 +105,7 @@ class BindServiceModel extends global.yoho.BaseModel {
105 sendChangeBindMobileCodeOnly(params) { 105 sendChangeBindMobileCodeOnly(params) {
106 return this.get({data: { 106 return this.get({data: {
107 method: 'app.bind.sendChangeBindMobileCodeOnlyImg', 107 method: 'app.bind.sendChangeBindMobileCodeOnlyImg',
108 - business_line: 'yohobuy', 108 + business_line: FROM[params.from].business_line,
109 mobile: params.mobile || '', 109 mobile: params.mobile || '',
110 area: params.area || '86', 110 area: params.area || '86',
111 degrees: params.captcha || '', 111 degrees: params.captcha || '',
@@ -119,7 +119,7 @@ class BindServiceModel extends global.yoho.BaseModel { @@ -119,7 +119,7 @@ class BindServiceModel extends global.yoho.BaseModel {
119 return this.get({ 119 return this.get({
120 data: Object.assign({ 120 data: Object.assign({
121 method: 'app.bind.changeMobileCheck', 121 method: 'app.bind.changeMobileCheck',
122 - business_line: 'yohobuy', 122 + business_line: FROM[params.from].business_line,
123 }, params) 123 }, params)
124 }); 124 });
125 } 125 }
@@ -128,7 +128,7 @@ class BindServiceModel extends global.yoho.BaseModel { @@ -128,7 +128,7 @@ class BindServiceModel extends global.yoho.BaseModel {
128 bindEmailLoginMobile(params) { 128 bindEmailLoginMobile(params) {
129 return this.get({data: { 129 return this.get({data: {
130 method: 'app.bind.bindEmailLoginMobile', 130 method: 'app.bind.bindEmailLoginMobile',
131 - business_line: 'yohobuy', 131 + business_line: FROM[params.from].business_line,
132 mobile: params.mobile || '', 132 mobile: params.mobile || '',
133 area: params.area || '86', 133 area: params.area || '86',
134 code: params.code, 134 code: params.code,
@@ -141,7 +141,7 @@ class BindServiceModel extends global.yoho.BaseModel { @@ -141,7 +141,7 @@ class BindServiceModel extends global.yoho.BaseModel {
141 sendThirdBindMobileCodeOnly(params) { 141 sendThirdBindMobileCodeOnly(params) {
142 return this.get({data: { 142 return this.get({data: {
143 method: 'app.bind.sendThirdBindMobileCodeOnlyImg', 143 method: 'app.bind.sendThirdBindMobileCodeOnlyImg',
144 - business_line: 'yohobuy', 144 + business_line: FROM[params.from].business_line,
145 mobile: params.mobile || '', 145 mobile: params.mobile || '',
146 area: params.area || '86', 146 area: params.area || '86',
147 superCapture: params.superCapture || '', 147 superCapture: params.superCapture || '',
@@ -154,7 +154,7 @@ class BindServiceModel extends global.yoho.BaseModel { @@ -154,7 +154,7 @@ class BindServiceModel extends global.yoho.BaseModel {
154 thirdBindMobile(params) { 154 thirdBindMobile(params) {
155 return this.get({data: { 155 return this.get({data: {
156 method: 'app.bind.bindMobile', 156 method: 'app.bind.bindMobile',
157 - business_line: 'yohobuy', 157 + business_line: FROM[params.from].business_line,
158 mobile: params.mobile || '', 158 mobile: params.mobile || '',
159 area: params.area || '86', 159 area: params.area || '86',
160 code: params.code, 160 code: params.code,