From 45a3a17d8776eee76824662feffe0283b775bd65 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 19 Jul 2019 15:43:40 +0800 Subject: [PATCH] fix register verify code expire bug --- app/controllers/accounts_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 6ac62f887..288cf2acc 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -35,7 +35,7 @@ class AccountsController < ApplicationController # todo 上线前请删除万能验证码"513231" if code != "513231" tip_exception(-2, "验证码不正确") if verifi_code.try(:code) != code.strip - tip_exception(-2, "验证码已失效") if (Time.now.to_i - verifi_code.created_at.to_i) <= 10*60 + tip_exception(-2, "验证码已失效") if (Time.now.to_i - verifi_code.created_at.to_i) > 10*60 end code = generate_identifier User, 8