Commit 54942dd8 by mingyuan

access token

parent b5f2d6d4
...@@ -40,7 +40,10 @@ module Dingtalk::Api ...@@ -40,7 +40,10 @@ module Dingtalk::Api
protected protected
def with_access_token(headers = {}, tries = 2) def with_access_token(headers = {}, tries = 2)
app.refresh_access_token unless app.access_token_valid? app.refresh_access_token unless app.access_token_valid?
yield headers.merge!(Authorization: "Bearer #{app.access_token}") yield headers.merge!(
Authorization: "Bearer #{app.access_token}",
'x-acs-dingtalk-access-token': app.access_token
)
rescue => e rescue => e
Rails.logger.debug e.full_message Rails.logger.debug e.full_message
app.refresh_access_token app.refresh_access_token
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment