From b41b357dbc0ed1892891ada5c10e3e0be4a5da07 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 17 Oct 2017 09:05:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=B3=BB=E7=BB=9F=E8=AE=A4?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e8e548c26..009b6f444 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -61,18 +61,18 @@ class ApplicationController < ActionController::Base end # 判断用户是否认证 - # def check_authentication - # # return true - # if params[:action] == "on_search" || params[:action] == "apply_trail" # 之所以这样处理是为了避开account页面ajax加载 - # return true - # end - # authentication = ApplyAction.where(:user_id => User.current.id, :status => 1).first - # user_identity = User.current.try(:user_extensions).try(:identity) - # if user_identity.blank? || authentication.blank? - # redirect_to my_account_path - # return - # end - # end + def check_authentication + # return true + if params[:action] == "on_search" || params[:action] == "apply_trail" # 之所以这样处理是为了避开account页面ajax加载 + return true + end + authentication = ApplyAction.where(:user_id => User.current.id, :status => 1).first + user_identity = User.current.try(:user_extensions).try(:identity) + if user_identity.blank? || authentication.blank? + redirect_to my_account_path + return + end + end def session_expiration if session[:user_id]