|
|
|
@ -88,11 +88,11 @@ class ApplicationController < ActionController::Base
|
|
|
|
|
sigle_para = {email: value}
|
|
|
|
|
# 60s内不能重复发送
|
|
|
|
|
send_email_limit_cache_key = "send_email_60_second_limit:#{value}"
|
|
|
|
|
tip_exception(-2, '请勿频繁操作') if Rails.cache.exist?(send_email_limit_cache_key)
|
|
|
|
|
tip_exception(-1, '请勿频繁操作') if Rails.cache.exist?(send_email_limit_cache_key)
|
|
|
|
|
|
|
|
|
|
# 短时间内不能大量发送
|
|
|
|
|
send_email_control = LimitForbidControl::SendEmailCode.new(value)
|
|
|
|
|
tip_exception(-2, '邮件发送太频繁,请稍后再试') if send_email_control.forbid?
|
|
|
|
|
tip_exception(-1, '邮件发送太频繁,请稍后再试') if send_email_control.forbid?
|
|
|
|
|
begin
|
|
|
|
|
UserMailer.register_email(value, code).deliver_now
|
|
|
|
|
|
|
|
|
|