From 08187be382994eab757f2d7e18229b03574b39de Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Fri, 31 Jan 2020 18:41:06 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=BB=9F=E8=AE=A1401=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/colleges_controller.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/colleges_controller.rb b/app/controllers/colleges_controller.rb index ee7b9c014..6c1b6b8f4 100644 --- a/app/controllers/colleges_controller.rb +++ b/app/controllers/colleges_controller.rb @@ -136,11 +136,11 @@ class CollegesController < ApplicationController private - def require_login - return if User.current.logged? - - redirect_to "/login?back_url=#{CGI::escape(request.fullpath)}" - end + # def require_login + # return if User.current.logged? + # + # redirect_to "/login?back_url=#{CGI::escape(request.fullpath)}" + # end def check_college_present! return if current_college.present? From 9e0095c64e1f3b719903398714983fdae5297354 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sun, 2 Feb 2020 12:12:14 +0800 Subject: [PATCH 2/3] test --- config/initializers/session_store.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index 2bbdbd0d2..06ba35f6e 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -4,5 +4,5 @@ # Rails.application.config.session_store :active_record_store # Be sure to restart your server when you modify this file. -# Rails.application.config.session_store :cache_store, :expire_after => 24.hours, key: '_educoder_session', domain: :all +Rails.application.config.session_store :cache_store, :expire_after => 24.hours, key: '_educoder_session', domain: :all From 901565cb3eb646ffb10bff0d09aa529b2b91ccf0 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sun, 2 Feb 2020 12:21:15 +0800 Subject: [PATCH 3/3] .. --- app/controllers/main_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index 75a6012b0..ba5b0f349 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -8,6 +8,10 @@ class MainController < ApplicationController end def index + domain_session = params[:_educoder_session] + if domain_session + cookies[:_educoder_session] = domain_session + end render file: 'public/react/build/index.html', :layout => false end end \ No newline at end of file