|
|
@@ -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<dynamic>(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 |
|
|
|