FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

【小程序/公众号】提供了更新access_token的消费接口 by FreeOfYou · Pull Request #3005 · binarywang/WxJava · GitHub

【小程序/公众号】提供了更新access_token的消费接口 - #3005

Merged
binarywang merged 9 commits into
binarywang:developfrom
FreeOfYou:feature/refeashTokenCallBack
May 11, 2023
Merged

【小程序/公众号】提供了更新access_token的消费接口#3005
binarywang merged 9 commits into
binarywang:developfrom
FreeOfYou:feature/refeashTokenCallBack

Conversation

Copy link
Copy Markdown

如何使用:

  1. 多个 appid 配置类,需要继承 WxMaDefaultConfigImpl;
  2. 设置 WxMaDefaultConfigImpl#setUpdateAccessTokenBefore 的消费者: 例子:
  public void init() {
    WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
//     //第一种方式
//    config.setUpdateAccessTokenBefore(e -> {
//      System.out.println("token:" + e.toString());
//    });
    //第二种方式
    config.setUpdateAccessTokenBefore(this::updateAccessTokenBefore);
  }

  private void updateAccessTokenBefore(WxAccessTokenEntity wxAccessTokenEntity) {
    System.out.println("token:" + wxAccessTokenEntity.toString());
  }
  1. 动态开启是否进行回调 WxMaDefaultConfigImpl#enableUpdateAccessTokenBefore,默认开启了回调

Copy link
Copy Markdown
Owner

请解决下冲突,谢谢

binarywang linked an issue May 8, 2023 that may be closed by this pull request
binarywang merged commit 899ea65 into binarywang:develop May 11, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

【小程序】建议提供获取access_token成功后相关回调

2 participants


Back | FazBrowse Home | New Git URL