|
|
|
@ -147,6 +147,7 @@ class ApplicationController < ActionController::Base
|
|
|
|
|
# 前端会捕捉401,弹登录弹框
|
|
|
|
|
# 未授权的捕捉407,弹试用申请弹框
|
|
|
|
|
def require_login
|
|
|
|
|
#6.13 -hs
|
|
|
|
|
tip_exception(401, "..") unless User.current.logged?
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -182,7 +183,7 @@ class ApplicationController < ActionController::Base
|
|
|
|
|
info_url = '/account/profile'
|
|
|
|
|
tip_exception(402, 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)
|
|
|
|
|
unless (Time.now.to_i - day_cer.try(:created_at).to_i) < 86400
|
|
|
|
|
tip_exception(407, "系统未授权")
|
|
|
|
|
end
|
|
|
|
|