mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:53:25 +08:00
【优化】完善微信公众号及移动端WAP浏览器下,H5端的多种分享功能的接口实现。
This commit is contained in:
@@ -10832,6 +10832,21 @@
|
|||||||
提现方式
|
提现方式
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</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">
|
<member name="T:CoreCms.Net.Model.FromBody.FMWxPost">
|
||||||
<summary>
|
<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 System.Threading.Tasks;
|
||||||
using CoreCms.Net.Caching.AccressToken;
|
using CoreCms.Net.Caching.AccressToken;
|
||||||
using CoreCms.Net.Model;
|
using CoreCms.Net.Model;
|
||||||
|
using CoreCms.Net.Model.FromBody;
|
||||||
using CoreCms.Net.WeChat.Service.Enums;
|
using CoreCms.Net.WeChat.Service.Enums;
|
||||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||||
using CoreCms.Net.WeChat.Service.Options;
|
using CoreCms.Net.WeChat.Service.Options;
|
||||||
@@ -44,15 +45,15 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public IActionResult GetWeChatConfig()
|
public IActionResult GetWeChatConfig(FMGetWeChatConfig entity)
|
||||||
{
|
{
|
||||||
//获取全局缓存的jsapi_ticket
|
//获取全局缓存的jsapi_ticket
|
||||||
var jsApiTicket = WeChatCacheAccessTokenHelper.GetWeChatJsApiTicket();
|
var jsApiTicket = WeChatCacheAccessTokenHelper.GetWeChatJsApiTicket();
|
||||||
var nonceStr = CoreCms.Net.Utility.Helper.CommonHelper.GetSerialNumber();
|
var nonceStr = CoreCms.Net.Utility.Helper.CommonHelper.GetSerialNumber();
|
||||||
var timestamp = CoreCms.Net.Utility.Helper.CommonHelper.GetTimeStampByTotalSeconds().ToString();
|
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);
|
var signature = CoreCms.Net.Utility.Helper.CommonHelper.Sha1Signature(signatureStr);
|
||||||
|
|
||||||
return new JsonResult(new
|
return new JsonResult(new
|
||||||
@@ -62,7 +63,8 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
|||||||
timestamp,
|
timestamp,
|
||||||
nonceStr,
|
nonceStr,
|
||||||
signature,
|
signature,
|
||||||
url
|
entity.url,
|
||||||
|
entity
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1514,7 +1514,7 @@
|
|||||||
<param name="weChatOptions"></param>
|
<param name="weChatOptions"></param>
|
||||||
<param name="weChatApiHttpClientFactory"></param>
|
<param name="weChatApiHttpClientFactory"></param>
|
||||||
</member>
|
</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>
|
<summary>
|
||||||
JS-SDK使用权限签名算法
|
JS-SDK使用权限签名算法
|
||||||
</summary>
|
</summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user