diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 288cf2acc..d81195598 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -91,7 +91,7 @@ class AccountsController < ApplicationController user = User.find_by_mail(email) #这里有问题,应该是为email,而不是mail 6.13-hs end 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 user.password, user.password_confirmation = params[:new_password], params[:new_password_confirmation] if user.save!