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. 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