mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-20 19:55:56 +08:00
短信ip限制2小时30次
This commit is contained in:
@@ -39,14 +39,14 @@ class InfoRiskControlService < ApplicationService
|
||||
def remote_ip_risk_control
|
||||
result = Rails.cache.read("InfoRiskControlService-RemoteIp-#{remote_ip}")
|
||||
if result.present?
|
||||
if result.to_i > 20
|
||||
if result.to_i > 30
|
||||
@status = 0
|
||||
@message = "暂时无法请求,请稍后再试"
|
||||
else
|
||||
Rails.cache.write("InfoRiskControlService-RemoteIp-#{remote_ip}", result.to_i + 1)
|
||||
end
|
||||
else
|
||||
Rails.cache.write("InfoRiskControlService-RemoteIp-#{remote_ip}", 1, expires_in: 1.day)
|
||||
Rails.cache.write("InfoRiskControlService-RemoteIp-#{remote_ip}", 1, expires_in: 2.hours)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user