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