Commit d3ba3fc5 by lanrion

made the authenticate method to private

parent 0b0e706c
...@@ -34,15 +34,6 @@ module WeixinAuthorize ...@@ -34,15 +34,6 @@ module WeixinAuthorize
@access_token @access_token
end end
# authenticate access_token
def authenticate
if is_weixin_redis_blank?
set_access_token_for_client
else
authenticate_with_redis
end
end
# 检查appid和app_secret是否有效。 # 检查appid和app_secret是否有效。
def is_valid? def is_valid?
valid_result = http_get_access_token valid_result = http_get_access_token
...@@ -64,6 +55,15 @@ module WeixinAuthorize ...@@ -64,6 +55,15 @@ module WeixinAuthorize
private private
# authenticate access_token
def authenticate
if is_weixin_redis_blank?
set_access_token_for_client
else
authenticate_with_redis
end
end
def authenticate_with_redis def authenticate_with_redis
set_access_token_for_client set_access_token_for_client
weixin_redis.hmset(redis_key, :access_token, access_token, :expired_at, expired_at) weixin_redis.hmset(redis_key, :access_token, access_token, :expired_at, expired_at)
......
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