Authored by 陈轩

账户密码优化 nodejs

... ... @@ -251,7 +251,7 @@ const setNewPasswordByMobilePage = (req, res) => {
let areaCode = req.query.areaCode || '86';
let code = req.query.code || '';
if (!(code || (token && helpers.verifyMobile(phoneNum)))) {
if (!(code || (token && /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/.test(phoneNum)))) {
res.redirect(400);
return;
}
... ...
... ... @@ -228,7 +228,7 @@ let setPassword = (req, res, next) => {
}
// 判断密码是否符合规则
if (!helpers.verifyPassword(password)) {
if (!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/.test(password)) {
return res.json(data);
}
... ...
... ... @@ -283,7 +283,7 @@ exports.password = (req, res, next) => {
return res.json(data);
}
if (!helpers.verifyPassword(password)) {
if (!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/.test(password)) {
return res.json(data);
}
... ...