Releases: EasyAbp/WeChatManagement
3.2.0
3.1.0
3.0.0
2.1.0
2.0.0
本次更新也升级了 EasyAbp.WeChat.Abp 模块到 2.0.0 版本,它包含了多项破坏性改动,如果你对此模块有重写、扩展等,也请参考:https://github.com/EasyAbp/Abp.WeChat/releases/tag/2.0.0
主要改动
- 由于 EasyAbp.WeChat.Abp 模块移除了 Options resolving 机制,本模块之前提供的
ClaimsWeChatMiniProgramOptionsResolveContributor
等设施已移除。如果你是多 appId 场景,相关的 HTTP API 接口现在一定会提供 appId 的入参(入参可能在路由上)。 - WeChatApp 实体的 WeChatComponentId 属性更名为 ComponentWeChatAppId。
- WeChatApp 实体的 AppSecret/Token/EncodingAesKey 属性名称增加 Encrypted 前缀,值由明文存储变更为密文存储。升级模块之前,请备份这些配置,并清空它们在数据表中的值,在升级后重新手动将它们重新设置。
- WeChatAppUser 实体的 SessionKey 属性更名为 EncryptedSessionKey,由明文存储变更为密文存储。升级模块之前,请清空所有 SessionKey 在数据表中的值。
- 引入了新的微信第三方平台管理模块,并提供了相关的回调接口、授权页面、授权管理页面等设施,详见:https://github.com/EasyAbp/Abp.WeChat/releases/tag/2.0.0
What's Changed
- 抛出Code2session产生的错误 by @indexlang in #60
- WeChat third-party platform module by @gdlcf88 in #65
- Upgrade to Abp.WeChat 2.0.0.rc.2 by @gdlcf88 in #66
- Encrypt
AppSecret
andSessionKey
by @gdlcf88 in #67 - Fix tests by @gdlcf88 in #68
- Fix 3rd-party platform APIs by @gdlcf88 in #69
- Upgrade to Abp.WeChat module 2.0.0-rc.5 by @gdlcf88 in #70
- Fix the auth callback api by @gdlcf88 in #71
- Refactor 3rd-party platform auth handling API by @gdlcf88 in #72
- Fix
GetAuthorizerInfoRequest
by @gdlcf88 in #73 - Enhance 3rd-party platform authorization by @gdlcf88 in #74
- Encrypt
Token
andEncodingAesKey
by @gdlcf88 in #75 - Add
ThirdPartyPlatformAuthorizedEto
by @gdlcf88 in #76 - Fix the bad
SetRefreshToken
invoking by @gdlcf88 in #77 - Make options providers fall back to default implement if appid is null by @gdlcf88 in #78
- Refactor controllers to resolve the ABP route warning by @gdlcf88 in #79
- Release 2.0.0 by @gdlcf88 in #81
New Contributors
- @indexlang made their first contribution in #60
Full Changelog: 1.5.0...2.0.0
1.5.0
Breaking Changes
LoginInput
和PcLoginInput
都新增了 Scope 入参,请传入合适的值。例如在 Sample 项目中,可以传入WeChatManagementSample
,如果不指定,访问与 Scope 相关 API 接口时,则 ABP 框架认定当前登录态不拥有操作权限。- 为避免 Claim
appid
与其他模块或应用设计冲突,修改其名称为wechat_appid
。
What's Changed
Full Changelog: 1.4.3...1.5.0
1.4.0
Breaking Changes
由于 ABP 6.0 引入了新的 OpenIddict 授权模块,我们对 OpenIddict 和 IDS4 两个模块做了并存兼容。你需要按照以下步骤从旧版模块中升级。
-
安装新的
EasyAbp.WeChatManagement.MiniPrograms.Domain.OpenIddict
模块或EasyAbp.WeChatManagement.MiniPrograms.Domain.Ids4
模块,代替原EasyAbp.WeChatManagement.MiniPrograms.Domain
模块。 -
在 Web/Host 项目的 appsettings.json 中增加微信登录授权服务器配置:
{ "WeChatManagement": { "MiniPrograms": { "AuthServer": { "Authority": "https://localhost:44380", "ClientId": "MyProjectName_WeChatMiniProgram", "ClientSecret": "1q2w3e*" } } } }
-
在 OpenIddictDataSeedContributor 中增加新的客户端 Data Seed (你也可以使用 IDS4):
// WeChat MiniProgram var weChatMiniProgramClientId = configurationSection["MyProjectName_WeChatMiniProgram:ClientId"]; if (!weChatMiniProgramClientId.IsNullOrWhiteSpace()) { await CreateApplicationAsync( name: weChatMiniProgramClientId, type: OpenIddictConstants.ClientTypes.Confidential, consentType: OpenIddictConstants.ConsentTypes.Implicit, displayName: "WeChat Mini-program", secret: configurationSection["MyProjectName_WeChatMiniProgram:ClientSecret"] ?? "1q2w3e*", grantTypes: new List<string> { WeChatMiniProgramConsts.GrantType, OpenIddictConstants.GrantTypes.RefreshToken }, scopes: commonScopes ); }
-
在 OpenIddictDataSeedContributor 中找到
if (grantType == OpenIddictConstants.GrantTypes.ClientCredentials) { application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.ClientCredentials); }
在下面增加
if (grantType == WeChatMiniProgramConsts.GrantType) { application.Permissions.Add($"gt:{WeChatMiniProgramConsts.GrantType}"); }
-
在 DbMigrator 项目的 appsettings.json 中增加:
{ "IdentityServer": { "Clients": { "MyProjectName_WeChatMiniProgram": { "ClientId": "MyProjectName_WeChatMiniProgram", "ClientSecret": "1q2w3e*" } } } }
-
运行 DbMigrator 项目,以创建新的授权客户端。
What's Changed
Full Changelog: 1.3.5...1.4.0
1.3.3
v1.0.0
完成了对“微信应用”的抽象(#7),使其范围不止于小程序,未来还将包括:公众号、企业微信、开放平台。
注意:本次更新不平滑
- 调整DbContext的引用:
https://github.com/EasyAbp/WeChatManagement/blob/e4ec04755b3b6c295da14f7a19c1a19be9641573/samples/WeChatManagementSample/aspnet-core/src/WeChatManagementSample.EntityFrameworkCore/EntityFrameworkCore/WeChatManagementSampleDbContext.cs#L78-L79 - 在EF的迁移文件手动做调整,参考:
https://github.com/EasyAbp/WeChatManagement/blob/e4ec04755b3b6c295da14f7a19c1a19be9641573/samples/WeChatManagementSample/aspnet-core/src/WeChatManagementSample.EntityFrameworkCore/Migrations/20210827092621_IntroducedWeChatApp.cs - 注意路由变化:
[Route("/api/wechat-management/mini-programs/mini-program")]
->[Route("/api/wechat-management/common/wechat-app")]
[Route("/api/wechat-management/mini-programs/mini-program-user")]
->[Route("/api/wechat-management/common/wechat-app-user")]
务必谨慎操作避免丢失数据!