Authored by 郝肖肖

'fix'

... ... @@ -74,7 +74,9 @@ exports.submit = (req, res) => {
];
if (req.body.pid) {
dels.push(cache.delAsync(decodeURIComponent(req.body.pid)));
let riskPid = decodeURIComponent(req.body.pid) + ':' + _.get(req.yoho, 'clientIp', '');
dels.push(cache.delAsync(riskPid));
}
yield Promise.all(dels).catch(e => {
... ...
... ... @@ -12,7 +12,7 @@ const logger = global.yoho.logger;
const statusCode = {
code: 4403,
date: {},
data: {},
message: '亲,您的访问次数过多,请稍后再试哦...'
};
... ... @@ -83,11 +83,11 @@ module.exports = () => {
return next();
}
let keyPath = `${_.trim(path, '/').replace(/\//g, ':')}:${ip}`;
let limitKey = `wap:risk:limit:${keyPath}`;
let configKey = `wap:risk:${keyPath}`;
let keyPath = `${_.trim(path, '/').replace(/\//g, ':')}`;
let limitKey = `wap:risk:limit:${keyPath}:${ip}`;
let configKey = `wap:risk:${keyPath}:${ip}`;
let checkUrl = helpers.urlFormat('/3party/check', {
pid: limitKey
pid: `wap:risk:limit:${keyPath}`
});
return Promise.all([
... ...
... ... @@ -52,7 +52,7 @@ $(document).ajaxError((event, xhr) => {
} else if (xhr.status === 403 && xhr.responseJSON.code === 4403) {
tip.show(xhr.responseJSON.message);
setTimeout(function() {
window.location.href = `${xhr.responseJSON.date.url}&refer=${encodeURIComponent(window.location.href)}`;
window.location.href = `${xhr.responseJSON.data.url}&refer=${encodeURIComponent(window.location.href)}`;
}, 2000);
}
});
... ...