fixed oauth2 请求区别

This commit is contained in:
xiaoxiaoqiong 2022-07-13 12:47:39 +08:00
parent d7a970e7d5
commit 25375b32c2
1 changed files with 1 additions and 1 deletions

View File

@ -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