Authored by 郭成尧

app-register-sendRegCodeToMobile-ok

@@ -177,6 +177,8 @@ class Reg { @@ -177,6 +177,8 @@ class Reg {
177 let mobile = +req.body.phoneNum; 177 let mobile = +req.body.phoneNum;
178 let area = +(req.body.areaCode || 86); 178 let area = +(req.body.areaCode || 86);
179 let inviteCode = req.body.inviteCode || ''; 179 let inviteCode = req.body.inviteCode || '';
  180 + let udid = req.sessionID;
  181 + let captcha = req.body.captcha;
180 182
181 // 判断参数是否合法 183 // 判断参数是否合法
182 if (!_.isNumber(mobile) || !_.isNumber(area)) { 184 if (!_.isNumber(mobile) || !_.isNumber(area)) {
@@ -184,8 +186,14 @@ class Reg { @@ -184,8 +186,14 @@ class Reg {
184 return res.json(data); 186 return res.json(data);
185 } 187 }
186 188
  189 + if (req.body.geetest_challenge) {
  190 + captcha = req.body.geetest_challenge; // TODO 使用极验证传特殊的值
  191 + }
  192 +
187 // 向手机发送注册验证码 193 // 向手机发送注册验证码
188 - req.ctx(RegServiceModel).sendCodeToMobile({area, mobile}).then((result) => { 194 + req.ctx(RegServiceModel).sendCodeToMobile({
  195 + area, mobile, udid, captcha
  196 + }).then((result) => {
189 if (result.code !== 200) { 197 if (result.code !== 200) {
190 data.message = result.message; 198 data.message = result.message;
191 return res.json(data); 199 return res.json(data);
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 'use strict'; 8 'use strict';
9 const aes = require('./aes-pwd'); 9 const aes = require('./aes-pwd');
10 const FROM = require('../../../config/from'); 10 const FROM = require('../../../config/from');
  11 +const PAGE = 'H5';
11 12
12 class RegServiceModel extends global.yoho.BaseModel { 13 class RegServiceModel extends global.yoho.BaseModel {
13 constructor(ctx) { 14 constructor(ctx) {
@@ -71,7 +72,10 @@ class RegServiceModel extends global.yoho.BaseModel { @@ -71,7 +72,10 @@ class RegServiceModel extends global.yoho.BaseModel {
71 return this.post({data: { 72 return this.post({data: {
72 method: 'app.register.sendRegCodeToMobile', 73 method: 'app.register.sendRegCodeToMobile',
73 area: params.area, 74 area: params.area,
74 - mobile: params.mobile 75 + mobile: params.mobile,
  76 + udid: params.udid,
  77 + fromPage: PAGE,
  78 + degrees: params.captcha
75 }}); 79 }});
76 } 80 }
77 81