From 28ae66071901ab1b3ecdff6c971afd34f613d9c7 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 22 Jun 2019 17:07:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 27 ++++++++++++----------- app/controllers/shixuns_controller.rb | 2 +- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1915281bf..1fffc0cb7 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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 # 身份资料的认证: diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 6dfa94252..5cc470d61 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -1,5 +1,5 @@ class ShixunsController < ApplicationController - # before_action :require_login, except: [:download_file, :index, :menus] + before_action :require_login, except: [:download_file, :index, :menus] before_action :check_auth, except: [:download_file, :index] before_action :find_shixun, except: [:index, :new, :create, :menus, :get_recommend_shixuns, :propaedeutics,