From 0669dcf907ec79533c9d8c80426ff856a158a0bb Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 3 Jun 2019 14:11:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/api.rb | 5 +++++ app/views/layouts/base_edu.html.erb | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/api/mobile/api.rb b/app/api/mobile/api.rb index e93c374c..af1b770d 100644 --- a/app/api/mobile/api.rb +++ b/app/api/mobile/api.rb @@ -83,6 +83,9 @@ module Mobile end def memo_authenticate! + Rails.logger.info("#######current_user: ###{current_user}") + Rails.logger.info("#######session: ###{session[:user_id]}") + pass = (request.path.match(/memos\/\d+/).present? && !request.path.include?("reply")) || request.path.include?("get_memos_list") || request.path.include?("memos?page=") || request.path.match(/memos$/).present? @@ -94,6 +97,8 @@ module Mobile end def discusses_authenticate! + Rails.logger.info("#######current_user: ###{current_user}") + Rails.logger.info("#######session: ###{session[:user_id]}") pass = request.path.match(/discusses$/).present? || request.path.include?("discusses?page=") unless pass error!('401 Unauthorized', 401) unless current_user diff --git a/app/views/layouts/base_edu.html.erb b/app/views/layouts/base_edu.html.erb index 2638a1df..06fa90b9 100644 --- a/app/views/layouts/base_edu.html.erb +++ b/app/views/layouts/base_edu.html.erb @@ -24,7 +24,8 @@ <%= javascript_include_tag '/editormd/lib/marked.min.js', '/editormd/lib/prettify.min.js', '/editormd/lib/raphael.min.js', '/editormd/lib/underscore.min.js', '/editormd/lib/sequence-diagram.min.js', '/editormd/lib/flowchart.min.js', '/editormd/lib/jquery.flowchart.min.js', '/editormd/editormd.js' %> <%= yield :header_tags -%> - + <% Rails.logger.info("########----current_user: #{User.current.id}") %> + <% Rails.logger.info("########----session: #{session[:user_id]}") %>