修复未绑定邮箱用户点击开始实战按钮页面无反应的bug

dev_partners
Alec Zhou 6 years ago
parent face0cc8de
commit 21043d1a6c

@ -3,7 +3,7 @@
class ShixunsController < ApplicationController
layout 'base_shixun'
before_filter :require_login, :except => [:ghook, :download_file, :show, :index]
before_filter :check_authentication, :except => [:ghook, :download_file, :show, :index]
before_filter :check_authentication, :except => [:ghook, :download_file, :show, :index, :operation]
before_filter :find_shixun, :except => [ :index, :new, :create, :index, :search, :shixun_courses, :new_disscuss, :shixun_migrate, :qrcode, :download_file, :departments, :get_mirror_script, :send_message_to_administrator]
skip_before_filter :verify_authenticity_token, :only => [:ghook, :download_file]

@ -612,13 +612,12 @@ module ApplicationHelper
=end
user_e = UserExtensions.where(:user_id => User.current.id).first
if User.current.lastname.blank? || user_e.school_id.blank? || user_e.identity.blank? || User.current.mail.blank?
redirect_to user_info_path()
redirect_to my_account_path
Rails.logger.info("check_authentication end")
return
elsif User.current.certification != 1 # 系统没有授权
day_cer = UserDayCertification.where(:user_id => User.current.id).last
unless (Time.now.to_i - day_cer.try(:created_at).to_i) < 86400
redirect_to my_account_path()
redirect_to my_account_path
Rails.logger.info("check_authentication end")
return
end

@ -1,6 +1,6 @@
<% if @mail %>
flag=true;
sure_box_redirect_btn('<%= security_settings_path %>', '开启实训,请先绑定邮箱','绑定邮箱');
sure_box_redirect_btn('<%= my_account_path %>', '开启实训,请先绑定邮箱','绑定邮箱');
<% else %>
<% if @is_modify.blank? %>
//为了防止浏览器阻挡,在实训路径中需要弹出新的页面,而实训首页又不需要弹出新的页面

Loading…
Cancel
Save