lijin
2025-11-21 0f9263238c5760267db714bb9fb6f4b86e202b22
ApiTools.Core/Utils/WxmpUtils/WxmpUtils.cs
@@ -4,6 +4,7 @@
using Azure.Core;
using Furion.FriendlyException;
using Furion.HttpRemote;
using Furion.JsonSerialization;
using Mapster;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Options;
@@ -15,8 +16,10 @@
using System.Net.Http.Json;
using System.Text;
using System.Text.Json.Nodes;
using System.Text.Unicode;
using System.Threading;
using System.Threading.Tasks;
using static System.Net.Mime.MediaTypeNames;
namespace ApiTools.Core
{
@@ -148,11 +151,14 @@
                .WithQueryParameter("access_token", accessToken)
                .SetJsonContent(jsonContent));
            response.EnsureSuccessStatusCode();
            if (response.Content.Headers.ContentType.ToString() == "application/json; charset=UTF-8")
            //var a = response.Content.Headers.ContentType.ToString();
            //application/json; encoding=utf-8
            //if (response.Content.Headers.ContentType.ToString() == "application/json; charset=UTF-8")
            if (response.Content.Headers.ContentType.ToString() == "application/json; encoding=utf-8")
            {
                var jsonResult = await response.Content.ReadAsStringAsync();
                var callback = jsonResult.JsonTo<SendResponse>();
                if (callback == null || callback.ErrorCode != 0)
                //var callback = jsonResult.JsonTo<SendResponse>();
                //if (callback == null || callback.ErrorCode != 0)
                    //throw Oops.Oh(EnumErrorCodeType.s510, $"获取小程序码失败:{callback.errmsg},请联系管理员");
                return jsonResult;
            }