Commit 7b649ffd by lanrion

synchronize get_access_token

parent 042497e8
# encoding: utf-8
require "monitor"
require "redis"
require 'digest/md5'
module WeixinAuthorize
class Client
include MonitorMixin
include Api::User
include Api::Menu
include Api::Custom
......@@ -26,12 +30,13 @@ module WeixinAuthorize
@redis_key = security_redis_key(options[:redis_key] || "weixin_#{app_id}")
@jsticket_redis_key = security_redis_key("js_sdk_#{app_id}")
@custom_access_token = options[:custom_access_token]
super() # Monitor#initialize
end
# return token
def get_access_token
return custom_access_token if !custom_access_token.nil?
token_store.access_token
synchronize{ token_store.access_token }
end
# 检查appid和app_secret是否有效。
......
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