Skip to content

Commit

Permalink
feat: 修改达到限制时的提示语
Browse files Browse the repository at this point in the history
  • Loading branch information
Herobrine-ymf committed Mar 31, 2023
1 parent 1cb1afe commit 7a6c48d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions service/src/middleware/limiter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ const maxCount = (isNotEmptyString(MAX_REQUEST_PER_HOUR) && !isNaN(Number(MAX_RE
const limiter = rateLimit({
windowMs: 60 * 60 * 1000, // Maximum number of accesses within an hour
max: maxCount,
statusCode: 200, // 200 means success,but the message is 'Too many request from this IP in 1 hour'
statusCode: 200, // 200 means success,but the message is '一小时内的请求次数太多了!请过段时间再试'
message: async (req, res) => {
res.send({ status: 'Fail', message: 'Too many request from this IP in 1 hour', data: null })
res.send({ status: 'Fail', message: '一小时内的请求次数太多了!请过段时间再试', data: null })
},
})

Expand Down

0 comments on commit 7a6c48d

Please sign in to comment.