|
|
const _ = require('lodash');
|
|
|
const url = require('url');
|
|
|
const helpers = global.yoho.helpers;
|
|
|
const RegService = require('../models/reg-service');
|
|
|
const RegServiceModel = require('../models/reg-service');
|
|
|
const utils = require(global.utils);
|
|
|
const sign = global.yoho.sign;
|
|
|
const co = require('bluebird').coroutine;
|
...
|
...
|
@@ -54,7 +54,7 @@ class Reg { |
|
|
let inviteCode = req.query.inviteCode;
|
|
|
|
|
|
if (inviteCode) {
|
|
|
let inviteUserInfo = yield RegService.inviteUserInfo(inviteCode);
|
|
|
let inviteUserInfo = yield req.ctx(RegServiceModel).inviteUserInfo(inviteCode);
|
|
|
|
|
|
inviteValue = _.get(inviteUserInfo, 'data.trendWord', inviteCode);
|
|
|
}
|
...
|
...
|
@@ -65,7 +65,7 @@ class Reg { |
|
|
localCss: true,
|
|
|
width750: true,
|
|
|
inviteValue: inviteValue,
|
|
|
countrys: RegService.getAreaData() // 地区信息列表
|
|
|
countrys: req.ctx(RegServiceModel).getAreaData() // 地区信息列表
|
|
|
});
|
|
|
})().catch(next);
|
|
|
}
|
...
|
...
|
@@ -109,7 +109,7 @@ class Reg { |
|
|
}
|
|
|
|
|
|
co(function* () {
|
|
|
let validMobileCodeResult = yield RegService.validMobileCode(area, mobile, smsCode);
|
|
|
let validMobileCodeResult = yield req.ctx(RegServiceModel).validMobileCode(area, mobile, smsCode);
|
|
|
|
|
|
if (!validMobileCodeResult.code) {
|
|
|
return res.json(validMobileCodeResult);
|
...
|
...
|
@@ -121,7 +121,7 @@ class Reg { |
|
|
return res.json(validMobileCodeResult);
|
|
|
}
|
|
|
|
|
|
let regMobileAesResult = yield RegService.regMobileAes(area, mobile, password,
|
|
|
let regMobileAesResult = yield req.ctx(RegServiceModel).regMobileAes(area, mobile, password,
|
|
|
shoppingKey, smsCode, inviteCode, isFromMy, from);
|
|
|
|
|
|
if (regMobileAesResult.code !== 200 || !regMobileAesResult.data ||
|
...
|
...
|
@@ -192,7 +192,7 @@ class Reg { |
|
|
|
|
|
|
|
|
// 向手机发送注册验证码
|
|
|
RegService.sendCodeToMobile(area, mobile).then((result) => {
|
|
|
req.ctx(RegServiceModel).sendCodeToMobile(area, mobile).then((result) => {
|
|
|
if (result.code !== 200) {
|
|
|
data.message = result.message;
|
|
|
return res.json(data);
|
...
|
...
|
|