diff --git a/app/controllers/admins/base_controller.rb b/app/controllers/admins/base_controller.rb index 0dbea8f..6115781 100644 --- a/app/controllers/admins/base_controller.rb +++ b/app/controllers/admins/base_controller.rb @@ -9,7 +9,6 @@ class Admins::BaseController < ApplicationController before_action :require_login, :require_admin! after_action :rebind_event_if_ajax_render_partial - skip_before_action :check_sign private diff --git a/app/controllers/admins/customers_controller.rb b/app/controllers/admins/customers_controller.rb index 8235bdb..80b0175 100644 --- a/app/controllers/admins/customers_controller.rb +++ b/app/controllers/admins/customers_controller.rb @@ -1,5 +1,4 @@ class Admins::CustomersController < Admins::BaseController - # skip_before_action :check_sign helper_method :current_partner def index diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a09c8e3..083a408 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -21,27 +21,6 @@ class ApplicationController < ActionController::Base helper_method :current_user - # 所有请求必须合法签名 - def check_sign - # if !Rails.env.development? - # Rails.logger.info("66666 #{params}") - # # suffix = request.url.split(".").last.split("?").first - # # suffix_arr = ["xls", "xlsx", "pdf", "zip"] # excel文件先注释 - # # unless suffix_arr.include?(suffix) - # if params[:client_key].present? - # randomcode = params[:randomcode] - # # tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5) - # - # sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}") - # Rails.logger.info("2222 #{sign}") - # tip_exception(501, "请求不合理") if sign != params[:client_key] - # else - # tip_exception(501, "请求不合理") - # end - # # end - # end - end - # 全局配置参数 # 返回name对应的value def edu_setting(name) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 34e9b32..63cfc23 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -5,7 +5,6 @@ class AttachmentsController < ApplicationController before_action :require_login, :check_auth, except: [:show] before_action :find_file, only: %i[show destroy] before_action :attachment_candown, only: [:show] - skip_before_action :check_sign, only: [:show, :create] include ApplicationHelper diff --git a/app/controllers/cooperative/base_controller.rb b/app/controllers/cooperative/base_controller.rb index 5d21598..dfc99b7 100644 --- a/app/controllers/cooperative/base_controller.rb +++ b/app/controllers/cooperative/base_controller.rb @@ -10,7 +10,6 @@ class Cooperative::BaseController < ApplicationController before_action :laboratory_exist!, :require_login, :require_cooperative_manager! after_action :rebind_event_if_ajax_render_partial - skip_before_action :check_sign helper_method :current_laboratory, :current_setting_or_default diff --git a/app/controllers/edu_apis_controller.rb b/app/controllers/edu_apis_controller.rb index afed6ed..e563af0 100644 --- a/app/controllers/edu_apis_controller.rb +++ b/app/controllers/edu_apis_controller.rb @@ -1,6 +1,5 @@ class EduApisController < ApplicationController before_action :check_validate - skip_before_action :check_sign skip_before_action :user_setup skip_before_action :setup_laboratory diff --git a/app/controllers/edu_settings_controller.rb b/app/controllers/edu_settings_controller.rb index e4787a0..95eb0b5 100644 --- a/app/controllers/edu_settings_controller.rb +++ b/app/controllers/edu_settings_controller.rb @@ -1,7 +1,6 @@ class EduSettingsController < ApplicationController before_action :require_admin before_action :set_edu_setting, only: [:show, :edit, :update, :destroy] - skip_before_action :check_sign # GET /edu_settings # GET /edu_settings.json def index diff --git a/app/controllers/gits_controller.rb b/app/controllers/gits_controller.rb index 60b4042..f401097 100644 --- a/app/controllers/gits_controller.rb +++ b/app/controllers/gits_controller.rb @@ -1,5 +1,4 @@ class GitsController < ApplicationController - skip_before_action :check_sign # 说明: # 以下Git认证只针对新版git,Gitlab的Git认证不走该控制器 # 思路: diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb index ed022fa..857f9fc 100644 --- a/app/controllers/hack_user_lastest_codes_controller.rb +++ b/app/controllers/hack_user_lastest_codes_controller.rb @@ -5,7 +5,6 @@ class HackUserLastestCodesController < ApplicationController before_action :update_user_hack_status, only: [:code_debug, :code_submit] before_action :require_auth_identity, only: [:add_notes] before_action :require_manager_identity, only: [:show, :update_code, :restore_initial_code, :sync_code] - skip_before_action :check_sign, only: [:listen_result] def show @my_hack.update_attribute(:submit_status, 0) if @my_hack.submit_status == 1 diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index 7db12f0..c451055 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -1,5 +1,4 @@ class MainController < ApplicationController - skip_before_action :check_sign skip_before_action :user_setup skip_before_action :setup_laboratory @@ -22,11 +21,11 @@ class MainController < ApplicationController end # TODO: 这块之后需要整合,者架构重新变化,统一跳转到index后再路由分发 - # if params[:path] && params[:path]&.include?("h5educoderbuild") && params[:path].split("/").first == "h5educoderbuild" - # render file: 'public/h5educoderbuild/index.html', :layout => false - # else - # render file: 'public/react/build/index.html', :layout => false - # end + if params[:path] && params[:path]&.include?("h5educoderbuild") && params[:path].split("/").first == "h5educoderbuild" + render file: 'public/h5educoderbuild/index.html', :layout => false + else + render file: 'public/react/build/index.html', :layout => false + end end end \ No newline at end of file diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index e6e1f28..f40320f 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -3,7 +3,6 @@ class MyshixunsController < ApplicationController before_action :find_myshixun, :except => [:training_task_status, :code_runinng_message] before_action :find_repo_name, :except => [:training_task_status, :code_runinng_message] skip_before_action :verify_authenticity_token, :only => [:html_content] - skip_before_action :check_sign, only: [:training_task_status, :code_runinng_message, :html_content] ## TPI关卡列表 def challenges diff --git a/app/controllers/partners_controller.rb b/app/controllers/partners_controller.rb index dfa1b20..7875e17 100644 --- a/app/controllers/partners_controller.rb +++ b/app/controllers/partners_controller.rb @@ -1,5 +1,4 @@ class PartnersController < ApplicationController - skip_before_action :check_sign include Base::PaginateHelper include Admins::RenderHelper diff --git a/app/controllers/schools_controller.rb b/app/controllers/schools_controller.rb index a62c004..b55eb10 100644 --- a/app/controllers/schools_controller.rb +++ b/app/controllers/schools_controller.rb @@ -1,5 +1,4 @@ class SchoolsController < ApplicationController - skip_before_action :check_sign def school_list schools = School.all diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index eb594e1..0e76e32 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -28,7 +28,6 @@ class ShixunsController < ApplicationController before_action :special_allowed, only: [:send_to_course, :search_user_courses] before_action :shixun_marker, only: [:new, :create] #before_action :validate_wachat_support, only: [:shixun_exec] - skip_before_action :check_sign, only: [:download_file] before_action :user_course_identity, only: [:export_scores] ## 获取课程列表 diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e7f4ba5..08ed8ae 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2,7 +2,6 @@ class UsersController < ApplicationController before_action :load_user, only: [:show, :homepage_info, :cancel_authentication, :cancel_professional_certification] before_action :check_user_exist, only: [:show, :homepage_info, :cancel_authentication, :cancel_professional_certification] - skip_before_action :check_sign, only: [:attachment_show] # 检查是否更新 def system_update