Authored by 郭成尧

app-register-sendRegCodeToMobile-ok

... ... @@ -177,6 +177,8 @@ class Reg {
let mobile = +req.body.phoneNum;
let area = +(req.body.areaCode || 86);
let inviteCode = req.body.inviteCode || '';
let udid = req.sessionID;
let captcha = req.body.captcha;
// 判断参数是否合法
if (!_.isNumber(mobile) || !_.isNumber(area)) {
... ... @@ -184,8 +186,14 @@ class Reg {
return res.json(data);
}
if (req.body.geetest_challenge) {
captcha = req.body.geetest_challenge; // TODO 使用极验证传特殊的值
}
// 向手机发送注册验证码
req.ctx(RegServiceModel).sendCodeToMobile({area, mobile}).then((result) => {
req.ctx(RegServiceModel).sendCodeToMobile({
area, mobile, udid, captcha
}).then((result) => {
if (result.code !== 200) {
data.message = result.message;
return res.json(data);
... ...
... ... @@ -8,6 +8,7 @@
'use strict';
const aes = require('./aes-pwd');
const FROM = require('../../../config/from');
const PAGE = 'H5';
class RegServiceModel extends global.yoho.BaseModel {
constructor(ctx) {
... ... @@ -71,7 +72,10 @@ class RegServiceModel extends global.yoho.BaseModel {
return this.post({data: {
method: 'app.register.sendRegCodeToMobile',
area: params.area,
mobile: params.mobile
mobile: params.mobile,
udid: params.udid,
fromPage: PAGE,
degrees: params.captcha
}});
}
... ...