fix register verify code expire bug

dev_forum
p31729568 6 years ago
parent eaacad16c0
commit 45a3a17d87

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

Loading…
Cancel
Save