Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

照着文档写的,没有效果啊,也没有报错 #1

Open
BGOnline-CN opened this issue Oct 24, 2019 · 1 comment
Open

照着文档写的,没有效果啊,也没有报错 #1

BGOnline-CN opened this issue Oct 24, 2019 · 1 comment

Comments

@BGOnline-CN
Copy link

config.default.js

  config.redis = {
    client: {
      port: 6379, // Redis port
      host: '127.0.0.1', // Redis host
      password: '',
      db: 0,
    }
  }

  config.ratelimiter = {
    // db: {},//如已配置egg-redis 可删除此配置
    router: [
      {
        path: '/api',
        max: 5,
        time: '7s', //时间单位 s m h d y ...
        message: '您的访问太快,请稍后再试!'//自定义请求超限错误信息
      }
    ]
  }

plugin.js

  ratelimiter: {
    enable: true,
    package: 'egg-ratelimiter',
  },
@ZQun
Copy link
Owner

ZQun commented May 17, 2020

@BGOnline-CN 原谅我才看到这个issues,这个插件需要同时安装egg-redis才可使用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants