|
|
|
@ -176,19 +176,20 @@ class ApplicationController < ActionController::Base
|
|
|
|
|
# 系统全局认证
|
|
|
|
|
#
|
|
|
|
|
def check_auth
|
|
|
|
|
old_edu_host = edu_setting('old_edu_host')
|
|
|
|
|
ue = current_user.user_extension
|
|
|
|
|
|
|
|
|
|
if current_user.lastname.blank? || ue.school_id.blank? || ue.identity.blank? || current_user.mail.blank?
|
|
|
|
|
info_url = old_edu_host + '/account/user_info'
|
|
|
|
|
render :json => { status: 402, url: info_url }
|
|
|
|
|
elsif current_user.certification != 1
|
|
|
|
|
day_cer = UserDayCertification.where(user_id: current_user.id).last
|
|
|
|
|
unless (Time.now.to_i - day_cer.try(:created_at).to_i) < 86400
|
|
|
|
|
account_url = old_edu_host + "/my/account"
|
|
|
|
|
render :json => { status: 402, url: account_url }
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
# old_edu_host = edu_setting('old_edu_host')
|
|
|
|
|
# ue = current_user.user_extension
|
|
|
|
|
#
|
|
|
|
|
# if current_user.lastname.blank? || ue.school_id.blank? || ue.identity.blank? || current_user.mail.blank?
|
|
|
|
|
# info_url = old_edu_host + '/account/user_info'
|
|
|
|
|
# render :json => { status: 402, url: info_url }
|
|
|
|
|
# elsif current_user.certification != 1
|
|
|
|
|
# day_cer = UserDayCertification.where(user_id: current_user.id).last
|
|
|
|
|
# unless (Time.now.to_i - day_cer.try(:created_at).to_i) < 86400
|
|
|
|
|
# account_url = old_edu_host + "/my/account"
|
|
|
|
|
# render :json => { status: 402, url: account_url }
|
|
|
|
|
# end
|
|
|
|
|
# end
|
|
|
|
|
true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 身份资料的认证:
|
|
|
|
|