...
|
...
|
@@ -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中
|
|
|
|
...
|
...
|
|