diff --git a/lib/dingtalk/client.rb b/lib/dingtalk/client.rb index cab0d57..55bfb7a 100644 --- a/lib/dingtalk/client.rb +++ b/lib/dingtalk/client.rb @@ -22,7 +22,7 @@ module Dingtalk end def signature(return_str) - sort_params = [suite.suite_access_token, timestamp, nonce, encrypt(return_str)].sort.join + sort_params = [Dingtalk.suite_token, timestamp, nonce, encrypt(return_str)].sort.join Digest::SHA1.hexdigest(sort_params) end diff --git a/lib/dingtalk/config.rb b/lib/dingtalk/config.rb index ec008a4..b7d8c7f 100644 --- a/lib/dingtalk/config.rb +++ b/lib/dingtalk/config.rb @@ -22,9 +22,13 @@ module Dingtalk def suite_aes_key @suite_aes_key ||= config.suite_aes_key end + + def suite_token + @suite_token ||= config.suite_token + end end class Config - attr_accessor :redis, :redis_options, :suite_key, :suite_secret, :suite_aes_key + attr_accessor :redis, :redis_options, :suite_key, :suite_secret, :suite_aes_key, :suite_token end end -- libgit2 0.21.0