...
|
...
|
@@ -7,7 +7,7 @@ const cookie = global.yoho.cookie; |
|
|
const EventEmitter = require('events');
|
|
|
const utils = require(global.utils);
|
|
|
const RegServiceModel = require('../models/reg-service');
|
|
|
const PhoneService = require('../models/phone-service');
|
|
|
const PhoneServiceModel = require('../models/phone-service');
|
|
|
const AuthHelper = require('../models/auth-helper');
|
|
|
const LoginNewModel = require('../models/login-new');
|
|
|
|
...
|
...
|
@@ -81,7 +81,7 @@ class SmsLogin { |
|
|
_.set(req.session, 'smsLogin.step', 2);
|
|
|
req.session.captcha = null;
|
|
|
|
|
|
PhoneService.sendSMS(mobile, area, 1);
|
|
|
req.ctx(PhoneServiceModel).sendSMS(mobile, area, 1);
|
|
|
|
|
|
res.json({
|
|
|
code: 200,
|
...
|
...
|
@@ -153,7 +153,7 @@ class SmsLogin { |
|
|
let area = _.get(req.session, 'smsLogin.area');
|
|
|
let mobile = _.get(req.session, 'smsLogin.mobile');
|
|
|
|
|
|
PhoneService.sendSMS(mobile, area, 1).then(result => {
|
|
|
req.ctx(PhoneServiceModel).sendSMS(mobile, area, 1).then(result => {
|
|
|
if (result.code === 200) {
|
|
|
|
|
|
_.set(req.session, 'smsLogin.step', 2);
|
...
|
...
|
@@ -212,8 +212,8 @@ class SmsLogin { |
|
|
}
|
|
|
|
|
|
Promise.all([
|
|
|
PhoneService.checkUserPhoneExist(mobile, area),
|
|
|
PhoneService.verifySMS(mobile, area, code, 1)
|
|
|
req.ctx(PhoneServiceModel).checkUserPhoneExist(mobile, area),
|
|
|
req.ctx(PhoneServiceModel).verifySMS(mobile, area, code, 1)
|
|
|
])
|
|
|
.then(result => {
|
|
|
let r1 = result[0] || {};
|
...
|
...
|
@@ -258,7 +258,7 @@ class SmsLogin { |
|
|
}
|
|
|
|
|
|
// 手机号码已注册 --> 直接登录
|
|
|
PhoneService.autoSignin({
|
|
|
req.ctx(PhoneServiceModel).autoSignin({
|
|
|
profile: mobile,
|
|
|
code: r2.data.code,
|
|
|
area,
|
...
|
...
|
|