注册后的一天试用申请

dev_forum
cxt 6 years ago
parent daff54613d
commit 2dc1255abf

@ -109,6 +109,9 @@ class AccountsController < ApplicationController
set_autologin_cookie(user)
UserAction.create(:action_id => user.try(:id), :action_type => "Login", :user_id => user.try(:id))
# 注册完成后有一天的试用申请
UserDayCertification.create(user_id: user.id, status: 1)
end
def set_autologin_cookie(user)

@ -154,7 +154,7 @@ class ApplicationController < ActionController::Base
tip_exception(402, info_url)
# render :json => { status: 402, url: info_url }
elsif current_user.certification != 1
day_cer = UserDayCertification.where(user_id: current_user.id).last
day_cer = UserDayCertification.find_by(user_id: current_user.id)
tip_exception(407, "系统未授权") unless (Time.now.to_i - day_cer.try(:created_at).to_i) < 86400
end
else

Loading…
Cancel
Save