From 4e51ad0cf38445df22da46a73968a42e26167dca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cxxq250=E2=80=9D?= <“xxq250@qq.com”> Date: Tue, 19 Jul 2022 17:51:56 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E4=BF=AE=E6=94=B9=E8=B7=A8=E5=9F=9F?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/application.rb | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/config/application.rb b/config/application.rb index 4d226c5ae..ee73c3670 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,4 +1,5 @@ require_relative 'boot' +require_relative '../lib/middleware/silence_log.rb' require 'rails/all' @@ -6,7 +7,7 @@ require 'rails/all' # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) -module Gitlink +module Educoderplus class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. config.load_defaults 5.2 @@ -17,11 +18,11 @@ module Gitlink # the framework and any gems in your application. # # - # config.gitlink = config_for(:configuration) + # config.educoder = config_for(:configuration) - # Custom directories with classes and modules you want to be autoloadable. + config.assets.precompile += %w( promotion.js promotion.css ) - config.active_record.default_timezone = :utc + config.active_record.default_timezone = :local config.time_zone = 'Beijing' # I18n @@ -31,9 +32,6 @@ module Gitlink # job config.active_job.queue_adapter = :sidekiq - # disable actioncable development nend true - # config.action_cable.disable_request_forgery_protection = true - config.middleware.use OmniAuth::Builder do provider :cas, url: 'https://urp.tfswufe.edu.cn/cas' end @@ -43,7 +41,7 @@ module Gitlink # origins '*' origins /http:\/\/localhost(:\d+)?\z/, /^(http|https):\/\/(.*(gitlink.org.cn))$/ # location of your api - resource '/*', :headers => :any, :methods => [:get, :post, :delete, :options, :put, :patch] + resource '/*', :headers => :any, :methods => [:get, :post, :delete, :options, :put], credentials: true end end end