{"action":"created","issue":{"url":"https://api.github.com/repos/borball/weixin-sdk/issues/37","repository_url":"https://api.github.com/repos/borball/weixin-sdk","labels_url":"https://api.github.com/repos/borball/weixin-sdk/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/borball/weixin-sdk/issues/37/comments","events_url":"https://api.github.com/repos/borball/weixin-sdk/issues/37/events","html_url":"https://github.com/borball/weixin-sdk/issues/37","id":222958399,"node_id":"MDU6SXNzdWUyMjI5NTgzOTk=","number":37,"title":"DefaultAccessTokenHolder","user":{"login":"mycoco2014","id":17588270,"node_id":"MDQ6VXNlcjE3NTg4Mjcw","avatar_url":"https://avatars0.githubusercontent.com/u/17588270?v=4","gravatar_id":"","url":"https://api.github.com/users/mycoco2014","html_url":"https://github.com/mycoco2014","followers_url":"https://api.github.com/users/mycoco2014/followers","following_url":"https://api.github.com/users/mycoco2014/following{/other_user}","gists_url":"https://api.github.com/users/mycoco2014/gists{/gist_id}","starred_url":"https://api.github.com/users/mycoco2014/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mycoco2014/subscriptions","organizations_url":"https://api.github.com/users/mycoco2014/orgs","repos_url":"https://api.github.com/users/mycoco2014/repos","events_url":"https://api.github.com/users/mycoco2014/events{/privacy}","received_events_url":"https://api.github.com/users/mycoco2014/received_events","type":"User","site_admin":false},"labels":[{"id":264827656,"node_id":"MDU6TGFiZWwyNjQ4Mjc2NTY=","url":"https://api.github.com/repos/borball/weixin-sdk/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":{"login":"borball","id":2533592,"node_id":"MDQ6VXNlcjI1MzM1OTI=","avatar_url":"https://avatars3.githubusercontent.com/u/2533592?v=4","gravatar_id":"","url":"https://api.github.com/users/borball","html_url":"https://github.com/borball","followers_url":"https://api.github.com/users/borball/followers","following_url":"https://api.github.com/users/borball/following{/other_user}","gists_url":"https://api.github.com/users/borball/gists{/gist_id}","starred_url":"https://api.github.com/users/borball/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borball/subscriptions","organizations_url":"https://api.github.com/users/borball/orgs","repos_url":"https://api.github.com/users/borball/repos","events_url":"https://api.github.com/users/borball/events{/privacy}","received_events_url":"https://api.github.com/users/borball/received_events","type":"User","site_admin":false},"assignees":[{"login":"borball","id":2533592,"node_id":"MDQ6VXNlcjI1MzM1OTI=","avatar_url":"https://avatars3.githubusercontent.com/u/2533592?v=4","gravatar_id":"","url":"https://api.github.com/users/borball","html_url":"https://github.com/borball","followers_url":"https://api.github.com/users/borball/followers","following_url":"https://api.github.com/users/borball/following{/other_user}","gists_url":"https://api.github.com/users/borball/gists{/gist_id}","starred_url":"https://api.github.com/users/borball/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borball/subscriptions","organizations_url":"https://api.github.com/users/borball/orgs","repos_url":"https://api.github.com/users/borball/repos","events_url":"https://api.github.com/users/borball/events{/privacy}","received_events_url":"https://api.github.com/users/borball/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2017-04-20T06:05:37Z","updated_at":"2019-06-14T01:47:51Z","closed_at":null,"author_association":"NONE","body":"MpWxClientFactory:\r\naccessTokenHolder = (AccessTokenHolder)Class.forName(clazz).newInstance(); //默认的没有构造函数，确定可以？？？\r\naccessTokenHolder.setClientId(appSetting.getAppId());\r\naccessTokenHolder.setClientSecret(appSetting.getSecret());\r\naccessTokenHolder.setTokenUrl(url);\r\n\r\nDefaultAccessTokenHolder:\r\n\r\npublic class DefaultAccessTokenHolder extends AccessTokenHolder {\r\n\r\n    private AccessToken accessToken;\r\n\r\n    public DefaultAccessTokenHolder(String tokenUrl, String clientId, String clientSecret){\r\n        super(tokenUrl, clientId, clientSecret);\r\n    }\r\n\r\n    @Override\r\n    public synchronized AccessToken getAccessToken() {\r\n        if (accessToken == null || accessToken.expired()) {\r\n            refreshToken();\r\n        }\r\n        return accessToken;\r\n    }\r\n\r\n    @Override\r\n    public synchronized void refreshToken() {\r\n        if (accessToken == null || accessToken.expired()) {\r\n            String content = fetchAccessToken();\r\n            AccessToken accessToken = AccessToken.fromJson(content);\r\n            this.accessToken = accessToken;\r\n        }\r\n    }\r\n\r\n    @Override\r\n    public void expireToken() {\r\n        accessToken.setExpiresIn(-30);//强制设置为无效\r\n    }\r\n}\r\n\r\n哎。。。。"},"comment":{"url":"https://api.github.com/repos/borball/weixin-sdk/issues/comments/501937845","html_url":"https://github.com/borball/weixin-sdk/issues/37#issuecomment-501937845","issue_url":"https://api.github.com/repos/borball/weixin-sdk/issues/37","id":501937845,"node_id":"MDEyOklzc3VlQ29tbWVudDUwMTkzNzg0NQ==","user":{"login":"borball","id":2533592,"node_id":"MDQ6VXNlcjI1MzM1OTI=","avatar_url":"https://avatars3.githubusercontent.com/u/2533592?v=4","gravatar_id":"","url":"https://api.github.com/users/borball","html_url":"https://github.com/borball","followers_url":"https://api.github.com/users/borball/followers","following_url":"https://api.github.com/users/borball/following{/other_user}","gists_url":"https://api.github.com/users/borball/gists{/gist_id}","starred_url":"https://api.github.com/users/borball/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borball/subscriptions","organizations_url":"https://api.github.com/users/borball/orgs","repos_url":"https://api.github.com/users/borball/repos","events_url":"https://api.github.com/users/borball/events{/privacy}","received_events_url":"https://api.github.com/users/borball/received_events","type":"User","site_admin":false},"created_at":"2019-06-14T01:47:51Z","updated_at":"2019-06-14T01:47:51Z","author_association":"OWNER","body":"Check this https://github.com/borball/weixin-sdk/commit/8999f2667f4f997e6c1dfc17ea853f82b7dec04e "}}
{"actor":{"display_login":"borball"}}