Commit 19729d3d by lanrion

added storage

parent c6eea351
...@@ -13,12 +13,14 @@ module WeixinAuthorize ...@@ -13,12 +13,14 @@ module WeixinAuthorize
attr_accessor :app_id, :app_secret, :expired_at # Time.now + expires_in attr_accessor :app_id, :app_secret, :expired_at # Time.now + expires_in
attr_accessor :access_token, :redis_key attr_accessor :access_token, :redis_key
attr_accessor :storage
def initialize(app_id, app_secret, redis_key=nil) def initialize(app_id, app_secret, redis_key=nil)
@app_id = app_id @app_id = app_id
@app_secret = app_secret @app_secret = app_secret
@expired_at = Time.now.to_i @expired_at = Time.now.to_i
@redis_key = security_redis_key((redis_key || "weixin_" + app_id)) @redis_key = security_redis_key((redis_key || "weixin_" + app_id))
@storage = Storage.init_with(weixin_redis || self)
end end
# return token # return 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