|
|
|
@ -34,8 +34,8 @@ class AccountsController < ApplicationController
|
|
|
|
|
# check_code = (verifi_code.try(:code) == code.strip && (Time.now.to_i - verifi_code.created_at.to_i) <= 10*60)
|
|
|
|
|
# todo 上线前请删除万能验证码"513231"
|
|
|
|
|
if code != "513231"
|
|
|
|
|
tip_exception(-2, "验证码不正确") if verifi_code.try(:code) != code.strip
|
|
|
|
|
tip_exception(-2, "验证码已失效") if !verifi_code&.effective?
|
|
|
|
|
return normal_status(-2, "验证码不正确") if verifi_code.try(:code) != code.strip
|
|
|
|
|
return normal_status(-2, "验证码已失效") if !verifi_code&.effective?
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
code = generate_identifier User, 8
|
|
|
|
@ -94,8 +94,8 @@ class AccountsController < ApplicationController
|
|
|
|
|
verifi_code = VerificationCode.where(email: email, code: code, code_type: 3).last
|
|
|
|
|
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 !verifi_code&.effective?
|
|
|
|
|
return normal_status(-2, "验证码不正确") if verifi_code.try(:code) != code.strip
|
|
|
|
|
return normal_status(-2, "验证码已失效") if !verifi_code&.effective?
|
|
|
|
|
|
|
|
|
|
user.password, user.password_confirmation = params[:new_password], params[:new_password_confirmation]
|
|
|
|
|
if user.save!
|
|
|
|
|