From 25375b32c2167825eec214c62db6b5c0ec90b3d3 Mon Sep 17 00:00:00 2001 From: xiaoxiaoqiong Date: Wed, 13 Jul 2022 12:47:39 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20oauth2=20=E8=AF=B7=E6=B1=82=E5=8C=BA?= =?UTF-8?q?=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index fb1968f28..82aa95879 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -248,7 +248,7 @@ class ApplicationController < ActionController::Base #return if params[:controller] == "main" # Find the current user #Rails.logger.info("current_laboratory is #{current_laboratory} domain is #{request.subdomain}") - if request.headers["Authorization"].present? + if request.headers["Authorization"].present? && request.headers["Authorization"].start_with?('Bearer') tip_exception(401, "请登录后再操作!") unless valid_doorkeeper_token? if @doorkeeper_token.present? # client方法对接,需要一直带着用户标识uid