From 9db06eae4da48d5555e76ac38f7b56b51009d5f8 Mon Sep 17 00:00:00 2001 From: Denley Hsiao Date: Tue, 20 Sep 2016 10:19:23 +0800 Subject: [PATCH 1/2] Change getticket#type from 1 to 'jsapi' --- lib/weixin_authorize/js_ticket/store.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/weixin_authorize/js_ticket/store.rb b/lib/weixin_authorize/js_ticket/store.rb index 2f6218e..0832f5e 100644 --- a/lib/weixin_authorize/js_ticket/store.rb +++ b/lib/weixin_authorize/js_ticket/store.rb @@ -30,7 +30,7 @@ def jsticket end def set_jsticket - result = client.http_get("/ticket/getticket", {type: 1}).result + result = client.http_get("/ticket/getticket", {type: 'jsapi'}).result client.jsticket = result["ticket"] client.jsticket_expired_at = WeixinAuthorize.calculate_expire(result["expires_in"]) end From 3cf695c8b3a8dba5deebd0213c68be5bd02ce1c1 Mon Sep 17 00:00:00 2001 From: Denley Hsiao Date: Mon, 31 Oct 2016 17:50:56 +0800 Subject: [PATCH 2/2] FIX BUG: config is nil. --- lib/weixin_authorize/config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/weixin_authorize/config.rb b/lib/weixin_authorize/config.rb index 30b5ddb..ffda3da 100644 --- a/lib/weixin_authorize/config.rb +++ b/lib/weixin_authorize/config.rb @@ -14,7 +14,7 @@ def weixin_redis end def key_expired - config.key_expired || 100 + config.try{ |conf| conf.key_expired } || 100 end # 可选配置: RestClient timeout, etc.