GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 【小程序/公众号】提供了更新access_token的消费接口 by FreeOfYou · Pull Request #3005 · binarywang/WxJava

Conversation

@FreeOfYou

@FreeOfYou FreeOfYou commented May 6, 2023

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,默认开启了回调

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
FreeOfYou added 4 commits May 5, 2023 19:38
@FreeOfYou
🆕 binarywang#3000 【小程序/公众号】提供了更新access_token的消费接口
6221707
@FreeOfYou
🎨 add unit test
6b29f51
@FreeOfYou
🎨 add default interface
12452a8
@FreeOfYou
🎨 add test
5d840f3
sonatype-lift[bot]
sonatype-lift Bot reviewed May 6, 2023
View reviewed changes
Comment thread weixin-java-common/src/main/java/me/chanjar/weixin/common/bean/WxAccessTokenEntity.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@FreeOfYou
🎨 remove note
4ee1293
sonatype-lift[bot]
sonatype-lift Bot reviewed May 6, 2023
View reviewed changes
Comment thread ...n-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/config/impl/WxMaDefaultConfigImpl.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

FreeOfYou added 3 commits May 6, 2023 14:34
@FreeOfYou
🎨 remove note
b7e7937
@FreeOfYou
🎨 remove note
a224924
@FreeOfYou
Merge remote-tracking branch 'origin/feature/refeashTokenCallBack' in…
80e1b8a
…to feature/refeashTokenCallBack
@binarywang

binarywang commented May 6, 2023

Copy link
Copy Markdown
Owner

请解决下冲突,谢谢

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@FreeOfYou
Merge branch 'develop' into feature/refeashTokenCallBack
ff95b46
@binarywang binarywang linked an issue May 8, 2023 that may be closed by this pull request
【小程序】建议提供获取access_token成功后相关回调 #3000
Closed
@binarywang
binarywang merged commit 899ea65 into binarywang:develop May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sonatype-lift sonatype-lift[bot] sonatype-lift[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

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

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@FreeOfYou @binarywang
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.