|
|
@@ -102,6 +102,13 @@ namespace Learun.Application.WebApi.Modules |
|
|
|
return Success(new { appid, secret }); |
|
|
|
} |
|
|
|
|
|
|
|
public class wxinfo |
|
|
|
{ |
|
|
|
public string errcode { get; set; } |
|
|
|
public string errmsg { get; set; } |
|
|
|
public string openid { get; set; } |
|
|
|
} |
|
|
|
|
|
|
|
public Response GetWeixinAccess_token(dynamic _) |
|
|
|
{ |
|
|
|
var entity = weChatConfigIbll.GetEnableEntity(); |
|
|
@@ -112,7 +119,7 @@ namespace Learun.Application.WebApi.Modules |
|
|
|
var responsejson = HttpGet("https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + appid + "&secret=" + secret + "&code=" + code + "&grant_type=authorization_code"); |
|
|
|
if (!string.IsNullOrEmpty(responsejson)) |
|
|
|
{ |
|
|
|
var weixintokenobj = JsonConvert.DeserializeObject<dynamic>(responsejson); |
|
|
|
var weixintokenobj = JsonConvert.DeserializeObject<wxinfo>(responsejson); |
|
|
|
if (string.IsNullOrEmpty(weixintokenobj.errcode)) |
|
|
|
{ |
|
|
|
string openid = weixintokenobj.openid; |
|
|
|