diff --git a/app/libs/gitlink_oauth/service.rb b/app/libs/gitlink_oauth/service.rb index 8afc913c..25b5803c 100644 --- a/app/libs/gitlink_oauth/service.rb +++ b/app/libs/gitlink_oauth/service.rb @@ -7,7 +7,15 @@ module GitlinkOauth::Service begin Rails.logger.info("[GitlinkOauth] [#{method.to_s.upcase}] #{url} || #{params}") - client = Faraday.new(url: GitlinkOauth.base_url) + # client = Faraday.new(url: GitlinkOauth.base_url) + client = Faraday.new(url: GitlinkOauth.base_url) do |req| + req.request :url_encoded + req.headers['Content-Type'] = 'application/json' + req.response :logger # 显示日志 + req.adapter Faraday.default_adapter + req.authorization :Bearer, params[:access_token] + req.headers['Authorization'] + end response = client.public_send(method, url, params) result = JSON.parse(response.body)