...
|
...
|
@@ -9,6 +9,7 @@ const AuthHelper = require('../models/auth-helper'); |
|
|
// constrant
|
|
|
const CODE_REQUIRED = '请输入校验码';
|
|
|
const PASSWORD_REQUIRED = '请输入密码';
|
|
|
const PASSWORD_LENGTH_ERROR = '密码6-20位,请重新输入';
|
|
|
const BAD_PASSWORD = '密码格式不正确';
|
|
|
const TOO_MANY = '请求太频繁';
|
|
|
const LOGIN_SUCCSS = '登录成功';
|
...
|
...
|
@@ -81,9 +82,9 @@ exports.loginPage = (req, res, next) => { |
|
|
return res.redirect(req.path);
|
|
|
}
|
|
|
|
|
|
// if (step === 3 && smsLoginStep !== 3) {
|
|
|
// return res.redirect(req.path);
|
|
|
// }
|
|
|
if (step === 3 && smsLoginStep !== 3) {
|
|
|
return res.redirect(req.path);
|
|
|
}
|
|
|
|
|
|
switch (step) {
|
|
|
case 2:
|
...
|
...
|
@@ -270,6 +271,11 @@ exports.password = (req, res, next) => { |
|
|
return res.json(data);
|
|
|
}
|
|
|
|
|
|
if (password.length < 6 || password.length > 20) {
|
|
|
data.message = PASSWORD_LENGTH_ERROR;
|
|
|
return res.json(data);
|
|
|
}
|
|
|
|
|
|
if (!helpers.verifyPassword(password)) {
|
|
|
return res.json(data);
|
|
|
}
|
...
|
...
|
|