change risk router key
Showing
1 changed file
with
2 additions
and
1 deletions
@@ -9,6 +9,7 @@ const cache = global.yoho.cache.master; | @@ -9,6 +9,7 @@ const cache = global.yoho.cache.master; | ||
9 | const helpers = global.yoho.helpers; | 9 | const helpers = global.yoho.helpers; |
10 | const pathToRegexp = require('path-to-regexp'); | 10 | const pathToRegexp = require('path-to-regexp'); |
11 | const logger = global.yoho.logger; | 11 | const logger = global.yoho.logger; |
12 | +const md5 = require('yoho-md5'); | ||
12 | 13 | ||
13 | const statusCode = { | 14 | const statusCode = { |
14 | code: 4403, | 15 | code: 4403, |
@@ -83,7 +84,7 @@ module.exports = () => { | @@ -83,7 +84,7 @@ module.exports = () => { | ||
83 | return next(); | 84 | return next(); |
84 | } | 85 | } |
85 | 86 | ||
86 | - let keyPath = `${_.trim(path, '/').replace(/\//g, ':')}`; | 87 | + let keyPath = md5(`${router.regRoute}`); |
87 | let limitKey = `wap:risk:limit:${keyPath}:${ip}`; | 88 | let limitKey = `wap:risk:limit:${keyPath}:${ip}`; |
88 | let configKey = `wap:risk:${keyPath}:${ip}`; | 89 | let configKey = `wap:risk:${keyPath}:${ip}`; |
89 | let checkUrl = helpers.urlFormat('/3party/check', { | 90 | let checkUrl = helpers.urlFormat('/3party/check', { |
-
Please register or login to post a comment