|
|
|
@ -185,21 +185,29 @@ class ApplicationController < ActionController::Base
|
|
|
|
|
render :json => { status: status, message: message }
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 系统全局认证
|
|
|
|
|
def check_auth
|
|
|
|
|
day_cer = UserDayCertification.find_by(user_id: current_user.id)
|
|
|
|
|
# 如果注册超过24小时则需要完善资料及授权
|
|
|
|
|
if (Time.now.to_i - day_cer.try(:created_at).to_i) > 86400
|
|
|
|
|
if !current_user.profile_completed?
|
|
|
|
|
info_url = '/account/profile'
|
|
|
|
|
tip_exception(402, info_url)
|
|
|
|
|
elsif current_user.certification != 1
|
|
|
|
|
if current_user.apply_actions.exists?(container_type: 'TrialAuthorization', status: 0)
|
|
|
|
|
tip_exception(408, "您的试用申请正在审核中,请耐心等待")
|
|
|
|
|
end
|
|
|
|
|
tip_exception(407, "系统未授权")
|
|
|
|
|
end
|
|
|
|
|
# 资料是否完善
|
|
|
|
|
def check_account
|
|
|
|
|
if !current_user.profile_completed?
|
|
|
|
|
info_url = '/account/profile'
|
|
|
|
|
tip_exception(402, info_url)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 系统全局认证(暂时隐藏试用申请的判断)
|
|
|
|
|
def check_auth
|
|
|
|
|
# day_cer = UserDayCertification.find_by(user_id: current_user.id)
|
|
|
|
|
# # 如果注册超过24小时则需要完善资料及授权
|
|
|
|
|
# if (Time.now.to_i - day_cer.try(:created_at).to_i) > 86400
|
|
|
|
|
# if !current_user.profile_completed?
|
|
|
|
|
# info_url = '/account/profile'
|
|
|
|
|
# tip_exception(402, info_url)
|
|
|
|
|
# elsif current_user.certification != 1
|
|
|
|
|
# if current_user.apply_actions.exists?(container_type: 'TrialAuthorization', status: 0)
|
|
|
|
|
# tip_exception(408, "您的试用申请正在审核中,请耐心等待")
|
|
|
|
|
# end
|
|
|
|
|
# tip_exception(407, "系统未授权")
|
|
|
|
|
# end
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# if current_user.certification != 1 && current_user.apply_actions.exists?(container_type: 'TrialAuthorization', status: 0)
|
|
|
|
|