Merge branch 'master' into 'master'

添加系统认证功能

注册用户需要认证

See merge request !3
This commit is contained in:
黄井泉 2017-10-17 09:09:08 +08:00
commit dfcdadc722
1 changed files with 12 additions and 12 deletions

View File

@ -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]