From 44561b8a5196e6c93c1c0cbc3c442291fdd413cb Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 18 Jul 2019 16:01:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=95=E7=94=A8=E7=9A=84=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E4=B8=8D=E7=94=A8=E5=AE=8C=E5=96=84=E8=B5=84?= =?UTF-8?q?=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 875050642..6a7599f28 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -184,14 +184,13 @@ class ApplicationController < ActionController::Base end # 系统全局认证 - # def check_auth - if !current_user.profile_completed? - info_url = '/account/profile' - tip_exception(402, info_url) - elsif current_user.certification != 1 + if current_user.certification != 1 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 + elsif !current_user.profile_completed? + info_url = '/account/profile' + tip_exception(402, info_url) end end