-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
feat(weixin-java-mp): 新增 WxMpOAuth2Service 接口,修复网页授权能力缺失 #4041
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
2
commits into
develop
Choose a base branch
from
copilot/weixin-java-mp-fix-empty-wxmpoauth2service
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpOAuth2Service.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| package me.chanjar.weixin.mp.api; | ||
|
|
||
| import me.chanjar.weixin.common.service.WxOAuth2Service; | ||
|
|
||
| /** | ||
| * 微信公众号网页授权(OAuth2)服务接口. | ||
| * | ||
| * <p>完整文档见: | ||
| * <a href="https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_webpage_authorization.html"> | ||
| * 微信网页授权 | ||
| * </a> | ||
| * </p> | ||
| * | ||
| * <p>包含以下能力: | ||
| * <ul> | ||
| * <li>构建网页授权 URL</li> | ||
| * <li>通过 code 换取 access_token({@code sns/oauth2/access_token})</li> | ||
| * <li>刷新 access_token({@code sns/oauth2/refresh_token})</li> | ||
| * <li>获取用户基本信息({@code sns/userinfo})</li> | ||
| * <li>校验 access_token 是否有效({@code sns/auth})</li> | ||
| * </ul> | ||
| * </p> | ||
| * | ||
| * @author GitHub Copilot | ||
| */ | ||
| public interface WxMpOAuth2Service extends WxOAuth2Service { | ||
| } |
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
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing this public interface method from returning
WxOAuth2ServicetoWxMpOAuth2Servicechanges the JVM method descriptor. Applications or extensions compiled against the previous release will still invokeWxMpService.getOAuth2Service()Lme/chanjar/weixin/common/service/WxOAuth2Service;, but the upgraded interface no longer declares that method, so a jar-only upgrade can fail at runtime withNoSuchMethodErroreven though the new return value is assignable to the old type. Keep the old descriptor available (or avoid narrowing the interface signature) if this is intended to be backward compatible.Useful? React with 👍 / 👎.