From 6f9f7ad3ed8c437110fe89da43dbd389714523f7 Mon Sep 17 00:00:00 2001 From: dao Date: Mon, 10 Feb 2025 09:13:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Learun.Application.WebApi/Modules/WeixinApi.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/WeixinApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/WeixinApi.cs index 15db59d29..d464bc0df 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/WeixinApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/WeixinApi.cs @@ -247,11 +247,12 @@ namespace Learun.Application.WebApi.Modules string appid = entity?.APPId; string secret = entity?.secret; string url = Request.Query["url"]; + //{"errcode":40164,"errmsg":"invalid ip 221.205.112.95 ipv6 ::ffff:221.205.112.95, not in whitelist rid: 67a80ab9-40e5f38a-31aecf0b"} var responsejson = HttpGet("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + appid + "&secret=" + secret); if (!string.IsNullOrEmpty(responsejson)) { var weixintokenobj = JsonConvert.DeserializeObject(responsejson); - if (string.IsNullOrEmpty(weixintokenobj.errcodeValue)) + if (string.IsNullOrEmpty(weixintokenobj.errcode)) { string access_token = weixintokenobj.access_token; string jsapi_ticket = HttpGet("https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=" + access_token + "&type=jsapi"); @@ -268,12 +269,12 @@ namespace Learun.Application.WebApi.Modules } else { - return Fail("2.getticket 微信授权失败,请重试。" + weixinjsapiticketobj.errcode + weixinjsapiticketobj.errmsg+ ",access_tokenjson:" + responsejson); + return Fail("微信授权失败,请重试。" + weixinjsapiticketobj.errcode + weixinjsapiticketobj.errmsg); } } else { - return Fail("1.token 微信授权失败,请重试。" + weixintokenobj.errcode + weixintokenobj.errmsg+weixintokenobj.errcodeValue); + return Fail("微信授权失败,请重试。" + weixintokenobj.errcode + weixintokenobj.errmsg); } } else