| | |
| | | using Azure.Core; |
| | | using Furion.FriendlyException; |
| | | using Furion.HttpRemote; |
| | | using Furion.JsonSerialization; |
| | | using Mapster; |
| | | using Microsoft.Extensions.Caching.Distributed; |
| | | using Microsoft.Extensions.Options; |
| | |
| | | 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 |
| | | { |
| | |
| | | .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; |
| | | } |