From 9664ca001e3fb30e5478a858f36979825805ac7a Mon Sep 17 00:00:00 2001 From: yystopf Date: Thu, 27 Oct 2022 17:57:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E:=20=E9=82=AE=E7=AE=B1?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81=E9=87=8D=E6=96=B0=E5=8F=91=E9=80=81?= =?UTF-8?q?=E5=90=8E=E4=B9=8B=E5=89=8D=E7=9A=84=E9=AA=8C=E8=AF=81=E7=A0=81?= =?UTF-8?q?=E9=9C=80=E8=AE=BE=E7=BD=AE=E4=B8=BA=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/v1/users_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/api/v1/users_controller.rb b/app/controllers/api/v1/users_controller.rb index 1babd9bca..3c6bec6a6 100644 --- a/app/controllers/api/v1/users_controller.rb +++ b/app/controllers/api/v1/users_controller.rb @@ -29,6 +29,8 @@ class Api::V1::UsersController < Api::V1::BaseController tip_exception(-2,"邮件发送失败,请稍后重试") end ver_params = {code_type: code_type, code: verification_code, email: mail} + last_code = VerificationCode.where(code_type: code_type, email: mail).last + last_code.update_attributes!({created_at: Time.current - 10.minute}) if last_code.present? data = VerificationCode.new(ver_params) if data.save! render_ok