mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 17:13:26 +08:00
【优化】完善微信公众号及移动端WAP浏览器下,H5端的多种分享功能的接口实现。
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.AccressToken;
|
||||
using CoreCms.Net.Model;
|
||||
using CoreCms.Net.Model.FromBody;
|
||||
using CoreCms.Net.WeChat.Service.Enums;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using CoreCms.Net.WeChat.Service.Options;
|
||||
@@ -44,15 +45,15 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Authorize]
|
||||
public IActionResult GetWeChatConfig()
|
||||
public IActionResult GetWeChatConfig(FMGetWeChatConfig entity)
|
||||
{
|
||||
//获取全局缓存的jsapi_ticket
|
||||
var jsApiTicket = WeChatCacheAccessTokenHelper.GetWeChatJsApiTicket();
|
||||
var nonceStr = CoreCms.Net.Utility.Helper.CommonHelper.GetSerialNumber();
|
||||
var timestamp = CoreCms.Net.Utility.Helper.CommonHelper.GetTimeStampByTotalSeconds().ToString();
|
||||
var url = Request.GetTypedHeaders().Referer;
|
||||
//var url = Request.GetTypedHeaders().Referer;
|
||||
//获取前面
|
||||
var signatureStr = "jsapi_ticket=" + jsApiTicket + "&noncestr=" + nonceStr + "×tamp=" + timestamp + "&url=" + url;
|
||||
var signatureStr = "jsapi_ticket=" + jsApiTicket + "&noncestr=" + nonceStr + "×tamp=" + timestamp + "&url=" + entity.url;
|
||||
var signature = CoreCms.Net.Utility.Helper.CommonHelper.Sha1Signature(signatureStr);
|
||||
|
||||
return new JsonResult(new
|
||||
@@ -62,7 +63,8 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
timestamp,
|
||||
nonceStr,
|
||||
signature,
|
||||
url
|
||||
entity.url,
|
||||
entity
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user