diff --git a/src/MiniProgram/EasyAbp.Abp.WeChat.MiniProgram/Services/ACode/ACodeWeService.cs b/src/MiniProgram/EasyAbp.Abp.WeChat.MiniProgram/Services/ACode/ACodeWeService.cs index 59376fa..0266f33 100644 --- a/src/MiniProgram/EasyAbp.Abp.WeChat.MiniProgram/Services/ACode/ACodeWeService.cs +++ b/src/MiniProgram/EasyAbp.Abp.WeChat.MiniProgram/Services/ACode/ACodeWeService.cs @@ -10,7 +10,8 @@ namespace EasyAbp.Abp.WeChat.MiniProgram.Services.ACode /// public class ACodeWeService : MiniProgramAbpWeChatServiceBase { - public ACodeWeService(AbpWeChatMiniProgramOptions options, IAbpLazyServiceProvider lazyServiceProvider) : base(options, lazyServiceProvider) + public ACodeWeService(AbpWeChatMiniProgramOptions options, IAbpLazyServiceProvider lazyServiceProvider) : base( + options, lazyServiceProvider) { } @@ -19,16 +20,20 @@ public ACodeWeService(AbpWeChatMiniProgramOptions options, IAbpLazyServiceProvid /// /// 最大32个可见字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~,其它字符请自行编码为合法字符(因不支持%,中文无法使用 urlencode 处理,请使用其他编码方式) /// 必须是已经发布的小程序存在的页面(否则报错),例如 pages/index/index, 根路径前不要填加 /,不能携带参数(参数请放在scene字段里),如果不填写这个字段,默认跳主页面 + /// 检查 page 是否存在,为 true 时 page 必须是已经发布的小程序存在的页面(否则报错);为 false 时允许小程序未发布或者 page 不存在, 但 page 有数量上限(60000个)请勿滥用 + /// 要打开的小程序版本。正式版为 release,体验版为 trial,开发版为 develop /// 二维码的宽度,单位 px,最小 280px,最大 1280px /// 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调,默认 false /// auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示 /// 是否需要透明底色,为 true 时,生成透明底色的小程序 public virtual Task GetUnlimitedACodeAsync(string scene, string page = null, - short width = 430, bool autoColor = false, LineColorModel lineColor = null, bool isHyaline = false) + bool checkPage = true, string envVersion = "release", short width = 430, bool autoColor = false, + LineColorModel lineColor = null, bool isHyaline = false) { const string targetUrl = "https://api.weixin.qq.com/wxa/getwxacodeunlimit"; - var request = new GetUnlimitedACodeRequest(scene, page, width, autoColor, lineColor, isHyaline); + var request = new GetUnlimitedACodeRequest( + scene, page, checkPage, envVersion, width, autoColor, lineColor, isHyaline); return ApiRequester.RequestGetBinaryDataAsync( targetUrl, HttpMethod.Post, request, Options); diff --git a/src/MiniProgram/EasyAbp.Abp.WeChat.MiniProgram/Services/ACode/GetUnlimitedACodeRequest.cs b/src/MiniProgram/EasyAbp.Abp.WeChat.MiniProgram/Services/ACode/GetUnlimitedACodeRequest.cs index 758646e..b09955a 100644 --- a/src/MiniProgram/EasyAbp.Abp.WeChat.MiniProgram/Services/ACode/GetUnlimitedACodeRequest.cs +++ b/src/MiniProgram/EasyAbp.Abp.WeChat.MiniProgram/Services/ACode/GetUnlimitedACodeRequest.cs @@ -23,37 +23,50 @@ public class GetUnlimitedACodeRequest : MiniProgramCommonRequest [JsonProperty("page")] public string Page { get; protected set; } + /// + /// 检查 page 是否存在,为 true 时 page 必须是已经发布的小程序存在的页面(否则报错);为 false 时允许小程序未发布或者 page 不存在, 但 page 有数量上限(60000个)请勿滥用 + /// + [JsonPropertyName("check_path")] + [JsonProperty("check_path")] + public bool CheckPage { get; protected set; } + + /// + /// 要打开的小程序版本。正式版为 release,体验版为 trial,开发版为 develop + /// + [JsonPropertyName("env_version")] + [JsonProperty("env_version")] + public string EnvVersion { get; protected set; } + /// /// 二维码的宽度,单位 px,最小 280px,最大 1280px /// [JsonPropertyName("width")] [JsonProperty("width")] public short Width { get; protected set; } - + /// /// 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调,默认 false /// [JsonPropertyName("auto_color")] [JsonProperty("auto_color")] public bool AutoColor { get; set; } - + /// /// auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示 /// [JsonPropertyName("line_color")] [JsonProperty("line_color")] public LineColorModel LineColor { get; set; } - + /// /// 是否需要透明底色,为 true 时,生成透明底色的小程序 /// [JsonPropertyName("is_hyaline")] [JsonProperty("is_hyaline")] public bool IsHyaline { get; set; } - + protected GetUnlimitedACodeRequest() { - } /// @@ -61,15 +74,19 @@ protected GetUnlimitedACodeRequest() /// /// 最大32个可见字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~,其它字符请自行编码为合法字符(因不支持%,中文无法使用 urlencode 处理,请使用其他编码方式) /// 必须是已经发布的小程序存在的页面(否则报错),例如 pages/index/index, 根路径前不要填加 /,不能携带参数(参数请放在scene字段里),如果不填写这个字段,默认跳主页面 + /// 检查 page 是否存在,为 true 时 page 必须是已经发布的小程序存在的页面(否则报错);为 false 时允许小程序未发布或者 page 不存在, 但 page 有数量上限(60000个)请勿滥用 + /// 要打开的小程序版本。正式版为 release,体验版为 trial,开发版为 develop /// 二维码的宽度,单位 px,最小 280px,最大 1280px /// 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调,默认 false /// auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示 /// 是否需要透明底色,为 true 时,生成透明底色的小程序 - public GetUnlimitedACodeRequest(string scene, string page, short width, bool autoColor, - LineColorModel lineColor, bool isHyaline) + public GetUnlimitedACodeRequest(string scene, string page, bool checkPage, string envVersion, short width, + bool autoColor, LineColorModel lineColor, bool isHyaline) { Scene = scene; Page = page; + CheckPage = checkPage; + EnvVersion = envVersion; Width = width; AutoColor = autoColor; LineColor = lineColor;