|
|
|
@ -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!
|
|
|
|
|