...
|
...
|
@@ -82,6 +82,15 @@ const getUserInfoAPI = (req, res, next) => { |
|
|
const sendCodePage = (req, res, next) => {
|
|
|
let inputInfo = req.inputInfo;
|
|
|
|
|
|
if (req.session.mobile && req.session.mobile !== inputInfo.phone) {
|
|
|
req.session.mobile = '';
|
|
|
req.session.captcha = '';
|
|
|
return res.json({
|
|
|
code: 400,
|
|
|
message: '验证码失效',
|
|
|
data: ''
|
|
|
});
|
|
|
}
|
|
|
BackService.sendCodeToUserAsync(inputInfo.type, inputInfo.phone, inputInfo.area)
|
|
|
.then(result => {
|
|
|
if (!(result.code && result.code === 200)) {
|
...
|
...
|
@@ -122,8 +131,8 @@ const sendBackMobileAPI = (req, res, next) => { |
|
|
let area = req.body.area || '86';
|
|
|
|
|
|
// 检查上次的发送短信号码
|
|
|
if (req.session.sendMobile && req.session.sendMobile !== mobile) {
|
|
|
req.session.sendMobile = '';
|
|
|
if (req.session.mobile && req.session.mobile !== mobile) {
|
|
|
req.session.mobile = '';
|
|
|
req.session.captcha = '';
|
|
|
return res.json({
|
|
|
code: 400,
|
...
|
...
|
@@ -135,7 +144,7 @@ const sendBackMobileAPI = (req, res, next) => { |
|
|
BackService.sendCodeToMobileAsync(area, mobile)
|
|
|
.then(result => {
|
|
|
// 记录发送短信的号码
|
|
|
req.session.sendMobile = mobile;
|
|
|
req.session.mobile = mobile;
|
|
|
res.json(result);
|
|
|
})
|
|
|
.catch(next);
|
...
|
...
|
|