mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 17:43:26 +08:00
【优化】完善微信公众号及移动端WAP浏览器下,H5端的多种分享功能的接口实现。
This commit is contained in:
@@ -10832,6 +10832,21 @@
|
||||
提现方式
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:CoreCms.Net.Model.FromBody.FMGetWeChatConfig">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:CoreCms.Net.Model.FromBody.FMGetWeChatConfig.url">
|
||||
<summary>
|
||||
请求网址
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:CoreCms.Net.Model.FromBody.FMGetWeChatConfig.token">
|
||||
<summary>
|
||||
请求授权
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:CoreCms.Net.Model.FromBody.FMWxPost">
|
||||
<summary>
|
||||
小程序提交数据标准接收实体
|
||||
|
||||
26
CoreCms.Net.Model/FromBody/FMWeChatOffiaccount.cs
Normal file
26
CoreCms.Net.Model/FromBody/FMWeChatOffiaccount.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CoreCms.Net.Model.FromBody
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class FMGetWeChatConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 请求网址
|
||||
/// </summary>
|
||||
public string url { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求授权
|
||||
/// </summary>
|
||||
|
||||
public string token { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1514,7 +1514,7 @@
|
||||
<param name="weChatOptions"></param>
|
||||
<param name="weChatApiHttpClientFactory"></param>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.WebApi.Controllers.WeChatOffiaccountController.GetWeChatConfig">
|
||||
<member name="M:CoreCms.Net.Web.WebApi.Controllers.WeChatOffiaccountController.GetWeChatConfig(CoreCms.Net.Model.FromBody.FMGetWeChatConfig)">
|
||||
<summary>
|
||||
JS-SDK使用权限签名算法
|
||||
</summary>
|
||||
|
||||
Reference in New Issue
Block a user