Authored by 周少峰

del check user

... ... @@ -88,21 +88,6 @@ const getUserInfoAPI = (req, res, next) => {
.catch(next);
};
// 成功 next ,否则 return err json
const getUserInfoAPINoRes = (req, res, next) => {
let inputInfo = req.inputInfo;
req.session.type = 'back-step1';
service.findUserAsync(inputInfo.type, inputInfo.phone, inputInfo.area).then(d => {
if (d.code === 200) {
return next();
} else {
return res.json(d);
}
}).catch(next);
};
const fakeGetUserInfoAPI = (req, res) => {
return res.json({code: 200, message: '验证成功'});
};
... ... @@ -110,6 +95,7 @@ const fakeGetUserInfoAPI = (req, res) => {
const sendCodePage = (req, res, next) => {
let inputInfo = req.inputInfo;
req.session.type = 'back-step1';
service.sendCodeToUserAsync(inputInfo.type, inputInfo.phone, inputInfo.area)
.then(result => {
if (!(result.code && result.code === 200)) {
... ... @@ -504,7 +490,6 @@ module.exports = {
index, // 首页
fakeGetUserInfoAPI, // 通过邮箱或手机号获得用户信息
getUserInfoAPI, // 通过邮箱或手机号获得用户信息
getUserInfoAPINoRes, // 通过邮箱或手机号获得用户信息
sendCodePage, // 发送验证码到邮箱或者手机,然后跳转页面
saveInSession, // 保存状态到session中
... ...
... ... @@ -130,7 +130,6 @@ router.post('/passport/back/authcode',
router.post('/passport/back/email',
captcha.requiredAPI,
back.validateInputAPI,
back.getUserInfoAPINoRes,
back.sendCodePage,
back.saveInSession);
... ...
... ... @@ -12,8 +12,7 @@ var Captcha = require('../../plugins/captcha');
var emailAc = require('../common/ac-email'); // 邮箱自动完成
var emailReg = regx.emailRegx,
phoneRegx = regx.phoneRegx;
var emailReg = regx.emailRegx;
var $cr = $('#country-code-hide'),
$phoneNum = $('#phone-num'),
... ... @@ -37,12 +36,7 @@ function vaPn(v) {
v = $.trim(v);
if (v !== '') {
if (/^[0-9]+$/.test(v)) {
if (phoneRegx[$cr.val()].test(v)) {
pass = true;
} else {
errTxt = '手机号码格式不正确, 请重新输入';
pass = false;
}
pass = true;
} else {
if (emailReg.test(v)) {
pass = true;
... ...