Authored by 周少峰

del check user

@@ -88,21 +88,6 @@ const getUserInfoAPI = (req, res, next) => { @@ -88,21 +88,6 @@ const getUserInfoAPI = (req, res, next) => {
88 .catch(next); 88 .catch(next);
89 }; 89 };
90 90
91 -// 成功 next ,否则 return err json  
92 -const getUserInfoAPINoRes = (req, res, next) => {  
93 - let inputInfo = req.inputInfo;  
94 -  
95 - req.session.type = 'back-step1';  
96 -  
97 - service.findUserAsync(inputInfo.type, inputInfo.phone, inputInfo.area).then(d => {  
98 - if (d.code === 200) {  
99 - return next();  
100 - } else {  
101 - return res.json(d);  
102 - }  
103 - }).catch(next);  
104 -};  
105 -  
106 const fakeGetUserInfoAPI = (req, res) => { 91 const fakeGetUserInfoAPI = (req, res) => {
107 return res.json({code: 200, message: '验证成功'}); 92 return res.json({code: 200, message: '验证成功'});
108 }; 93 };
@@ -110,6 +95,7 @@ const fakeGetUserInfoAPI = (req, res) => { @@ -110,6 +95,7 @@ const fakeGetUserInfoAPI = (req, res) => {
110 const sendCodePage = (req, res, next) => { 95 const sendCodePage = (req, res, next) => {
111 let inputInfo = req.inputInfo; 96 let inputInfo = req.inputInfo;
112 97
  98 + req.session.type = 'back-step1';
113 service.sendCodeToUserAsync(inputInfo.type, inputInfo.phone, inputInfo.area) 99 service.sendCodeToUserAsync(inputInfo.type, inputInfo.phone, inputInfo.area)
114 .then(result => { 100 .then(result => {
115 if (!(result.code && result.code === 200)) { 101 if (!(result.code && result.code === 200)) {
@@ -504,7 +490,6 @@ module.exports = { @@ -504,7 +490,6 @@ module.exports = {
504 index, // 首页 490 index, // 首页
505 fakeGetUserInfoAPI, // 通过邮箱或手机号获得用户信息 491 fakeGetUserInfoAPI, // 通过邮箱或手机号获得用户信息
506 getUserInfoAPI, // 通过邮箱或手机号获得用户信息 492 getUserInfoAPI, // 通过邮箱或手机号获得用户信息
507 - getUserInfoAPINoRes, // 通过邮箱或手机号获得用户信息  
508 sendCodePage, // 发送验证码到邮箱或者手机,然后跳转页面 493 sendCodePage, // 发送验证码到邮箱或者手机,然后跳转页面
509 saveInSession, // 保存状态到session中 494 saveInSession, // 保存状态到session中
510 495
@@ -130,7 +130,6 @@ router.post('/passport/back/authcode', @@ -130,7 +130,6 @@ router.post('/passport/back/authcode',
130 router.post('/passport/back/email', 130 router.post('/passport/back/email',
131 captcha.requiredAPI, 131 captcha.requiredAPI,
132 back.validateInputAPI, 132 back.validateInputAPI,
133 - back.getUserInfoAPINoRes,  
134 back.sendCodePage, 133 back.sendCodePage,
135 back.saveInSession); 134 back.saveInSession);
136 135
@@ -12,8 +12,7 @@ var Captcha = require('../../plugins/captcha'); @@ -12,8 +12,7 @@ var Captcha = require('../../plugins/captcha');
12 12
13 var emailAc = require('../common/ac-email'); // 邮箱自动完成 13 var emailAc = require('../common/ac-email'); // 邮箱自动完成
14 14
15 -var emailReg = regx.emailRegx,  
16 - phoneRegx = regx.phoneRegx; 15 +var emailReg = regx.emailRegx;
17 16
18 var $cr = $('#country-code-hide'), 17 var $cr = $('#country-code-hide'),
19 $phoneNum = $('#phone-num'), 18 $phoneNum = $('#phone-num'),
@@ -37,12 +36,7 @@ function vaPn(v) { @@ -37,12 +36,7 @@ function vaPn(v) {
37 v = $.trim(v); 36 v = $.trim(v);
38 if (v !== '') { 37 if (v !== '') {
39 if (/^[0-9]+$/.test(v)) { 38 if (/^[0-9]+$/.test(v)) {
40 - if (phoneRegx[$cr.val()].test(v)) {  
41 - pass = true;  
42 - } else {  
43 - errTxt = '手机号码格式不正确, 请重新输入';  
44 - pass = false;  
45 - } 39 + pass = true;
46 } else { 40 } else {
47 if (emailReg.test(v)) { 41 if (emailReg.test(v)) {
48 pass = true; 42 pass = true;