Showing
3 changed files
with
9 additions
and
7 deletions
@@ -74,7 +74,9 @@ exports.submit = (req, res) => { | @@ -74,7 +74,9 @@ exports.submit = (req, res) => { | ||
74 | ]; | 74 | ]; |
75 | 75 | ||
76 | if (req.body.pid) { | 76 | if (req.body.pid) { |
77 | - dels.push(cache.delAsync(decodeURIComponent(req.body.pid))); | 77 | + let riskPid = decodeURIComponent(req.body.pid) + ':' + _.get(req.yoho, 'clientIp', ''); |
78 | + | ||
79 | + dels.push(cache.delAsync(riskPid)); | ||
78 | } | 80 | } |
79 | 81 | ||
80 | yield Promise.all(dels).catch(e => { | 82 | yield Promise.all(dels).catch(e => { |
@@ -12,7 +12,7 @@ const logger = global.yoho.logger; | @@ -12,7 +12,7 @@ const logger = global.yoho.logger; | ||
12 | 12 | ||
13 | const statusCode = { | 13 | const statusCode = { |
14 | code: 4403, | 14 | code: 4403, |
15 | - date: {}, | 15 | + data: {}, |
16 | message: '亲,您的访问次数过多,请稍后再试哦...' | 16 | message: '亲,您的访问次数过多,请稍后再试哦...' |
17 | }; | 17 | }; |
18 | 18 | ||
@@ -83,11 +83,11 @@ module.exports = () => { | @@ -83,11 +83,11 @@ module.exports = () => { | ||
83 | return next(); | 83 | return next(); |
84 | } | 84 | } |
85 | 85 | ||
86 | - let keyPath = `${_.trim(path, '/').replace(/\//g, ':')}:${ip}`; | ||
87 | - let limitKey = `wap:risk:limit:${keyPath}`; | ||
88 | - let configKey = `wap:risk:${keyPath}`; | 86 | + let keyPath = `${_.trim(path, '/').replace(/\//g, ':')}`; |
87 | + let limitKey = `wap:risk:limit:${keyPath}:${ip}`; | ||
88 | + let configKey = `wap:risk:${keyPath}:${ip}`; | ||
89 | let checkUrl = helpers.urlFormat('/3party/check', { | 89 | let checkUrl = helpers.urlFormat('/3party/check', { |
90 | - pid: limitKey | 90 | + pid: `wap:risk:limit:${keyPath}` |
91 | }); | 91 | }); |
92 | 92 | ||
93 | return Promise.all([ | 93 | return Promise.all([ |
@@ -52,7 +52,7 @@ $(document).ajaxError((event, xhr) => { | @@ -52,7 +52,7 @@ $(document).ajaxError((event, xhr) => { | ||
52 | } else if (xhr.status === 403 && xhr.responseJSON.code === 4403) { | 52 | } else if (xhr.status === 403 && xhr.responseJSON.code === 4403) { |
53 | tip.show(xhr.responseJSON.message); | 53 | tip.show(xhr.responseJSON.message); |
54 | setTimeout(function() { | 54 | setTimeout(function() { |
55 | - window.location.href = `${xhr.responseJSON.date.url}&refer=${encodeURIComponent(window.location.href)}`; | 55 | + window.location.href = `${xhr.responseJSON.data.url}&refer=${encodeURIComponent(window.location.href)}`; |
56 | }, 2000); | 56 | }, 2000); |
57 | } | 57 | } |
58 | }); | 58 | }); |
-
Please register or login to post a comment