forked from Trustie/forgeplus
fixed 第三方Gitlink登录
This commit is contained in:
parent
5ce3b4cea4
commit
dbafeb5cee
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue