...
|
...
|
@@ -115,6 +115,7 @@ let verifyMobile = (req, res, next) => { |
|
|
|
|
|
let mobile = +req.body.phoneNum;
|
|
|
let area = +(req.body.areaCode || 86);
|
|
|
let inviteCode = +req.body.inviteCode || '';
|
|
|
|
|
|
// 判断参数是否合法
|
|
|
if (!_.isNumber(mobile) || !_.isNumber(area)) {
|
...
|
...
|
@@ -153,7 +154,8 @@ let verifyMobile = (req, res, next) => { |
|
|
result.data = helpers.urlFormat('/passport/reg/code', {
|
|
|
token: token,
|
|
|
phoneNum: mobile,
|
|
|
areaCode: area
|
|
|
areaCode: area,
|
|
|
inviteCode: inviteCode
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
@@ -169,6 +171,7 @@ let codeAction = (req, res, next) => { |
|
|
let token = req.query.token;
|
|
|
let mobile = +req.query.phoneNum;
|
|
|
let area = +(req.query.areaCode || 86);
|
|
|
let inviteCode = +req.query.inviteCode || '';
|
|
|
|
|
|
// 判断是否允许访问, 不允许则跳转到错误页面
|
|
|
if (!_.isString(token) || !_.isNumber(mobile) || !sign.verifyToken(mobile, token)) {
|
...
|
...
|
@@ -190,6 +193,7 @@ let codeAction = (req, res, next) => { |
|
|
areaCode: area, // 默认的区号
|
|
|
phoneNum: mobile, // 手机号
|
|
|
token: token, // 访问令牌
|
|
|
inviteCode: inviteCode,
|
|
|
serviceUrl: serviceUrl // 在线客服
|
|
|
});
|
|
|
};
|
...
|
...
|
@@ -275,6 +279,7 @@ let verifyCode = (req, res, next) => { |
|
|
let mobile = +req.body.phoneNum;
|
|
|
let area = +(req.body.areaCode || 86);
|
|
|
let code = +req.body.code;
|
|
|
let inviteCode = +req.body.inviteCode || '';
|
|
|
|
|
|
/* 判断参数是否合法 */
|
|
|
if (!_.isNumber(mobile) || !_.isNumber(area) || !_.isNumber(code)) {
|
...
|
...
|
@@ -306,7 +311,8 @@ let verifyCode = (req, res, next) => { |
|
|
token: token,
|
|
|
phoneNum: mobile,
|
|
|
areaCode: area,
|
|
|
smsCode: code
|
|
|
smsCode: code,
|
|
|
inviteCode: inviteCode
|
|
|
});
|
|
|
break;
|
|
|
case 404:
|
...
|
...
|
@@ -326,6 +332,7 @@ let passwordAction = (req, res, next) => { |
|
|
let mobile = +req.query.phoneNum;
|
|
|
let area = +(req.query.areaCode || 86);
|
|
|
let smsCode = +req.query.smsCode;
|
|
|
let inviteCode = +req.query.inviteCode || '';
|
|
|
|
|
|
// 判断是否允许访问, 不允许则跳转到错误页面
|
|
|
if (!smsCode || !_.isString(token) || !_.isNumber(mobile) ||
|
...
|
...
|
@@ -345,7 +352,8 @@ let passwordAction = (req, res, next) => { |
|
|
areaCode: area, // 默认的区号
|
|
|
phoneNum: mobile, // 手机号
|
|
|
token: token, // 访问令牌
|
|
|
smsCode: smsCode // 手机验证码
|
|
|
smsCode: smsCode, // 手机验证码
|
|
|
inviteCode: inviteCode
|
|
|
});
|
|
|
};
|
|
|
|
...
|
...
|
@@ -362,6 +370,7 @@ let setPassword = (req, res, next) => { |
|
|
let token = req.body.token;
|
|
|
let smsCode = +req.body.smsCode;
|
|
|
let isFromMy = _.get(req.session, 'phoneReg.isFromMy', '0');
|
|
|
let inviteCode = req.body.inviteCode || '';
|
|
|
|
|
|
// 判断参数是否合法
|
|
|
if (!smsCode || !_.isString(token) || !_.isNumber(mobile) || !_.isNumber(area) || !password) {
|
...
|
...
|
@@ -386,7 +395,7 @@ let setPassword = (req, res, next) => { |
|
|
// 验证注册的标识码是否有效
|
|
|
let resultCopy = null;
|
|
|
|
|
|
RegService.regMobileAes(area, mobile, password, shoppingKey, smsCode, isFromMy).then((result) => {
|
|
|
RegService.regMobileAes(area, mobile, password, shoppingKey, smsCode, inviteCode, isFromMy).then((result) => {
|
|
|
if (!result.code || result.code !== 200) {
|
|
|
return res.send(result);
|
|
|
}
|
...
|
...
|
|