|
|
|
@ -31,7 +31,7 @@ class AccountsController < ApplicationController
|
|
|
|
|
phone = nil
|
|
|
|
|
verifi_code = VerificationCode.where(email: email, code: code, code_type: 8).last
|
|
|
|
|
end
|
|
|
|
|
uid_logger("start register: verifi_code is #{verifi_code}, code is #{code}, time is #{Time.now.to_i - verifi_code.created_at.to_i}")
|
|
|
|
|
uid_logger("start register: verifi_code is #{verifi_code}, code is #{code}, time is #{Time.now.to_i - verifi_code.try(:created_at).to_i}")
|
|
|
|
|
check_code = (verifi_code.try(:code) == code.strip && (Time.now.to_i - verifi_code.created_at.to_i) <= 10*60)
|
|
|
|
|
unless check_code
|
|
|
|
|
tip_exception("验证码无效")
|
|
|
|
|