|
|
@@ -9,6 +9,7 @@ using System.IO;
|
|
9
|
9
|
using ServiceWechat.Api.MessageHandlers;
|
|
10
|
10
|
using Senparc.Weixin.MP.MvcExtension;
|
|
11
|
11
|
using Microsoft.AspNetCore.Hosting;
|
|
|
12
|
+using Senparc.Weixin.MP.Helpers;
|
|
12
|
13
|
|
|
13
|
14
|
namespace ServiceWechat.Api.Controllers.WechatApis
|
|
14
|
15
|
{
|
|
|
@@ -101,6 +102,28 @@ namespace ServiceWechat.Api.Controllers.WechatApis
|
|
101
|
102
|
return new WeixinResult(messageHandler.FinalResponseDocument.ToString().Replace("\r\n", "").Replace(" ", ""));
|
|
102
|
103
|
}
|
|
103
|
104
|
|
|
|
105
|
+ /// <summary>
|
|
|
106
|
+ /// 供前端调用JSSDK,获取基本验证信息
|
|
|
107
|
+ /// </summary>
|
|
|
108
|
+ /// <returns></returns>
|
|
|
109
|
+ [HttpGet]
|
|
|
110
|
+ public IActionResult GetInfo()
|
|
|
111
|
+ {
|
|
|
112
|
+ var timestamp = JSSDKHelper.GetTimestamp(); //获取随机码
|
|
|
113
|
+ var nonce = JSSDKHelper.GetNoncestr();
|
|
|
114
|
+ var signature = CheckSignature.GetSignature(timestamp, nonce, Token);
|
|
|
115
|
+ return Ok(new
|
|
|
116
|
+ {
|
|
|
117
|
+ appid = AppId,
|
|
|
118
|
+ timestamp,
|
|
|
119
|
+ nonce,
|
|
|
120
|
+ signature
|
|
|
121
|
+ });
|
|
|
122
|
+ }
|
|
|
123
|
+
|
|
|
124
|
+
|
|
|
125
|
+
|
|
|
126
|
+
|
|
104
|
127
|
|
|
105
|
128
|
#region 生成带参数的微信公众号二维码 :暂无用
|
|
106
|
129
|
//public async Task<string> GetTicket()
|