...
|
...
|
@@ -52,6 +52,19 @@ exports.imgCheckRisk = (req, res, next) => { |
|
|
'X-Forwarded-For': req.yoho.clientIp || '',
|
|
|
'User-Agent': 'yoho/nodejs'
|
|
|
}
|
|
|
}).on('response', response => {
|
|
|
// status code 204 接口关闭图形验证码,通过cookie通知验证页刷行切换验证方式
|
|
|
if (response.statusCode === 204) {
|
|
|
res.cookie('refresh_page', 1, {
|
|
|
path: '/',
|
|
|
maxAge: 60000
|
|
|
});
|
|
|
|
|
|
delete req.session.apiRiskValidate;
|
|
|
req.session.apiRiskClear = true;
|
|
|
|
|
|
return res.json({code: 204});
|
|
|
}
|
|
|
}).pipe(res); // eslint-disable-line
|
|
|
}).catch(next);
|
|
|
};
|
...
|
...
|
|