...
|
...
|
@@ -29,14 +29,18 @@ const checkAPI = (req, res) => { |
|
|
};
|
|
|
|
|
|
const passwordRequired = (req, res, next) => {
|
|
|
|
|
|
// 默认账户密码登录需要验证码
|
|
|
// if (req.session.type === 'needCaptcha' && req.body.loginType === 'password') {
|
|
|
if (req.body.loginType === 'password') {
|
|
|
return requiredAPI(req, res, next);
|
|
|
if (_.get(req.app.pc, 'password.alwaysNeedCaptcha', false)) {
|
|
|
if (req.body.loginType === 'password') {
|
|
|
return requiredAPI(req, res, next);
|
|
|
}
|
|
|
} else {
|
|
|
return next();
|
|
|
if (req.session.type === 'needCaptcha' && req.body.loginType === 'password') {
|
|
|
return requiredAPI(req, res, next);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return next();
|
|
|
};
|
|
|
|
|
|
const tryGeetest = (req, res, next) => {
|
...
|
...
|
|