Authored by 陈轩

fix YH-4374

@@ -9,6 +9,7 @@ const AuthHelper = require('../models/auth-helper'); @@ -9,6 +9,7 @@ const AuthHelper = require('../models/auth-helper');
9 // constrant 9 // constrant
10 const CODE_REQUIRED = '请输入校验码'; 10 const CODE_REQUIRED = '请输入校验码';
11 const PASSWORD_REQUIRED = '请输入密码'; 11 const PASSWORD_REQUIRED = '请输入密码';
  12 +const PASSWORD_LENGTH_ERROR = '密码6-20位,请重新输入';
12 const BAD_PASSWORD = '密码格式不正确'; 13 const BAD_PASSWORD = '密码格式不正确';
13 const TOO_MANY = '请求太频繁'; 14 const TOO_MANY = '请求太频繁';
14 const LOGIN_SUCCSS = '登录成功'; 15 const LOGIN_SUCCSS = '登录成功';
@@ -81,9 +82,9 @@ exports.loginPage = (req, res, next) => { @@ -81,9 +82,9 @@ exports.loginPage = (req, res, next) => {
81 return res.redirect(req.path); 82 return res.redirect(req.path);
82 } 83 }
83 84
84 - // if (step === 3 && smsLoginStep !== 3) {  
85 - // return res.redirect(req.path);  
86 - // } 85 + if (step === 3 && smsLoginStep !== 3) {
  86 + return res.redirect(req.path);
  87 + }
87 88
88 switch (step) { 89 switch (step) {
89 case 2: 90 case 2:
@@ -270,6 +271,11 @@ exports.password = (req, res, next) => { @@ -270,6 +271,11 @@ exports.password = (req, res, next) => {
270 return res.json(data); 271 return res.json(data);
271 } 272 }
272 273
  274 + if (password.length < 6 || password.length > 20) {
  275 + data.message = PASSWORD_LENGTH_ERROR;
  276 + return res.json(data);
  277 + }
  278 +
273 if (!helpers.verifyPassword(password)) { 279 if (!helpers.verifyPassword(password)) {
274 return res.json(data); 280 return res.json(data);
275 } 281 }