Skip to content
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

设置DNS预解析域名data参数错误 Senparc.Weixin.Open.WxaAPIs.DomainApi.SetPrefetchDNSDomain #2883

Open
1 task
luchigster opened this issue Jul 13, 2023 · 2 comments
Labels
resolved 已解决

Comments

@luchigster
Copy link

问题描述

微信接口不支持多余的status参数,调用先有的接口会报异常

{"errcode":47001,"errmsg":"data format error rid: 64afa24c-3b09af04-725c1b00"}

这里的SetPrefetchDNSDomainData适合用来作返回值

namespace Senparc.Weixin.Open.WxaAPIs.Domain
{
    public class SetPrefetchDNSDomainData
    {
        public string url { get; set; }

        public int status { get; set; }
    }
}

这里的var data = new { prefetch_dns_domain };需要稍作优化才能正常调用

public static SetPrefetchDNSDomainResultJson SetPrefetchDNSDomain(string accessToken, List<SetPrefetchDNSDomainData> prefetch_dns_domain, int timeOut = 10000)
{
  string urlFormat = string.Format(Config.ApiMpHost + "/wxa/set_prefetchdnsdomain?access_token={0}", accessToken.AsUrlData());
- var data = new { prefetch_dns_domain };
+ var data = new { prefetch_dns_domain = prefetch_dns_domain.Select(x => new { url = x.url }) };
  return CommonJsonSend.Send<SetPrefetchDNSDomainResultJson>(null, urlFormat, data, CommonJsonSendType.POST, timeOut);
}
微信官方文档 URL

https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/domain-management/setPrefetchDomain.html

微信官方文档快照(直接复制关键内容到下方)
请求数据示例

{
  "prefetch_dns_domain":[
    {
      "url":"d1.com"
    },
    {
      "url":"d2.com"
    }
  ]
}
发现问题的模块
  • Senparc.Weixin.Open 版本:~
@JeffreySu JeffreySu added the task label Jul 13, 2023
mojinxun added a commit to mojinxun/WeiXinMPSDK that referenced this issue Jul 28, 2023
@mojinxun mojinxun mentioned this issue Jul 28, 2023
@mojinxun
Copy link
Contributor

@SenparcHai

JeffreySu added a commit that referenced this issue Jul 29, 2023
   1、解决问题:接收微信授权事件推送"快速创建个人小程序" 缺少字段 #2870
   2、解决问题:设置第三方平台服务器域名调用url参数错误 #2882
   3、解决问题:设置DNS预解析域名data参数错误

感谢 @mojinxun #2893 #2870 #2882 #2883
@JeffreySu JeffreySu added resolved 已解决 and removed task labels Jul 29, 2023
@JeffreySu
Copy link
Owner

已发布新版本,感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolved 已解决
Projects
None yet
Development

No branches or pull requests

3 participants