mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:43:26 +08:00
【新增】实现支付宝小程序适配。
This commit is contained in:
@@ -43,6 +43,8 @@ namespace CoreCms.Net.Configuration
|
|||||||
Sms = 2,
|
Sms = 2,
|
||||||
[Description("微信小程序拉取手机号")]
|
[Description("微信小程序拉取手机号")]
|
||||||
WeChatPhoneNumber = 3,
|
WeChatPhoneNumber = 3,
|
||||||
|
[Description("支付宝小程序拉取手机号")]
|
||||||
|
AliPhoneNumber = 4,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -0,0 +1,87 @@
|
|||||||
|
/***********************************************************************
|
||||||
|
* Project: CoreCms
|
||||||
|
* ProjectName: 核心内容管理系统
|
||||||
|
* Web: https://www.corecms.net
|
||||||
|
* Author: 大灰灰
|
||||||
|
* Email: jianweie@163.com
|
||||||
|
* CreateTime: 2024/4/10 星期三 22:28:09
|
||||||
|
* Description: 暂无
|
||||||
|
***********************************************************************/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq.Expressions;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using CoreCms.Net.Model.Entities;
|
||||||
|
using CoreCms.Net.Model.ViewModels.Basics;
|
||||||
|
using CoreCms.Net.Model.ViewModels.UI;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
|
||||||
|
namespace CoreCms.Net.IRepository
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 支付宝用户信息 工厂接口
|
||||||
|
/// </summary>
|
||||||
|
public interface ICoreCmsAliPayUserInfoRepository : IBaseRepository<CoreCmsAliPayUserInfo>
|
||||||
|
{
|
||||||
|
#region 重写增删改查操作===========================================================
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写异步插入方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<AdminUiCallBack> InsertAsync(CoreCmsAliPayUserInfo entity);
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写异步更新方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<AdminUiCallBack> UpdateAsync(CoreCmsAliPayUserInfo entity);
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写异步更新方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<AdminUiCallBack> UpdateAsync(List<CoreCmsAliPayUserInfo> entity);
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写删除指定ID的数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写删除指定ID集合的数据(批量删除)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ids"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写根据条件查询分页数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="predicate">判断集合</param>
|
||||||
|
/// <param name="orderByType">排序方式</param>
|
||||||
|
/// <param name="pageIndex">当前页面索引</param>
|
||||||
|
/// <param name="pageSize">分布大小</param>
|
||||||
|
/// <param name="orderByExpression"></param>
|
||||||
|
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<IPageList<CoreCmsAliPayUserInfo>> QueryPageAsync(
|
||||||
|
Expression<Func<CoreCmsAliPayUserInfo, bool>> predicate,
|
||||||
|
Expression<Func<CoreCmsAliPayUserInfo, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||||
|
int pageSize = 20, bool blUseNoLock = false);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="AlipaySDKNet.Standard" Version="4.9.78" />
|
||||||
<PackageReference Include="Essensoft.Paylink.WeChatPay" Version="4.1.3" />
|
<PackageReference Include="Essensoft.Paylink.WeChatPay" Version="4.1.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Aop.Api.Response;
|
||||||
using CoreCms.Net.Model.Entities;
|
using CoreCms.Net.Model.Entities;
|
||||||
using CoreCms.Net.Model.ViewModels.UI;
|
using CoreCms.Net.Model.ViewModels.UI;
|
||||||
|
|
||||||
@@ -35,6 +36,19 @@ namespace CoreCms.Net.IServices
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<WebApiCallBack> Refund(CoreCmsBillRefund refundInfo, CoreCmsBillPayments paymentInfo);
|
Task<WebApiCallBack> Refund(CoreCmsBillRefund refundInfo, CoreCmsBillPayments paymentInfo);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 根据票据返回app_auth_token相关信息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="code"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
AlipaySystemOauthTokenResponse GetAliPayAppAuthTokenBYCode(string code);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="token"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
AlipayUserInfoShareResponse GetAliPayUserInfoByToken(string token);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
83
CoreCms.Net.IServices/User/ICoreCmsAliPayUserInfoServices.cs
Normal file
83
CoreCms.Net.IServices/User/ICoreCmsAliPayUserInfoServices.cs
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
/***********************************************************************
|
||||||
|
* Project: CoreCms
|
||||||
|
* ProjectName: 核心内容管理系统
|
||||||
|
* Web: https://www.corecms.net
|
||||||
|
* Author: 大灰灰
|
||||||
|
* Email: jianweie@163.com
|
||||||
|
* CreateTime: 2024/4/10 星期三 22:28:09
|
||||||
|
* Description: 暂无
|
||||||
|
***********************************************************************/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq.Expressions;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using CoreCms.Net.Model.Entities;
|
||||||
|
using CoreCms.Net.Model.ViewModels.Basics;
|
||||||
|
using CoreCms.Net.Model.ViewModels.UI;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace CoreCms.Net.IServices
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 支付宝用户信息 服务工厂接口
|
||||||
|
/// </summary>
|
||||||
|
public interface ICoreCmsAliPayUserInfoServices : IBaseServices<CoreCmsAliPayUserInfo>
|
||||||
|
{
|
||||||
|
#region 重写增删改查操作===========================================================
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写异步插入方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<AdminUiCallBack> InsertAsync(CoreCmsAliPayUserInfo entity);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写异步更新方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<AdminUiCallBack> UpdateAsync(CoreCmsAliPayUserInfo entity);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写异步更新方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<AdminUiCallBack> UpdateAsync(List<CoreCmsAliPayUserInfo> entity);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写删除指定ID的数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写删除指定ID集合的数据(批量删除)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ids"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 重写根据条件查询分页数据
|
||||||
|
/// <summary>
|
||||||
|
/// 重写根据条件查询分页数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="predicate">判断集合</param>
|
||||||
|
/// <param name="orderByType">排序方式</param>
|
||||||
|
/// <param name="pageIndex">当前页面索引</param>
|
||||||
|
/// <param name="pageSize">分布大小</param>
|
||||||
|
/// <param name="orderByExpression"></param>
|
||||||
|
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<IPageList<CoreCmsAliPayUserInfo>> QueryPageAsync(
|
||||||
|
Expression<Func<CoreCmsAliPayUserInfo, bool>> predicate,
|
||||||
|
Expression<Func<CoreCmsAliPayUserInfo, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||||
|
int pageSize = 20, bool blUseNoLock = false);
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -101,10 +101,10 @@ namespace CoreCms.Net.IServices
|
|||||||
/// 手机短信验证码登陆,同时兼有手机短信注册的功能,还有第三方账户绑定的功能
|
/// 手机短信验证码登陆,同时兼有手机短信注册的功能,还有第三方账户绑定的功能
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="entity">实体数据</param>
|
/// <param name="entity">实体数据</param>
|
||||||
/// <param name="loginType">登录方式(1普通,2短信,3微信小程序拉取手机号)</param>
|
/// <param name="loginType">登录方式(1普通,2短信,3微信小程序拉取手机号,4支付宝小程序拉取手机号)</param>
|
||||||
/// <param name="platform"></param>
|
/// <param name="platform"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<WebApiCallBack> SmsLogin(FMWxAccountCreate entity,
|
Task<WebApiCallBack> SmsLogin(FMComAccountCreate entity,
|
||||||
int loginType = (int)GlobalEnumVars.LoginType.WeChatPhoneNumber, int platform = (int)GlobalEnumVars.CoreShopSystemCategory.Api);
|
int loginType = (int)GlobalEnumVars.LoginType.WeChatPhoneNumber, int platform = (int)GlobalEnumVars.CoreShopSystemCategory.Api);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.0" />
|
||||||
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="2.36.0" />
|
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="2.36.0" />
|
||||||
<PackageReference Include="sqlSugarCore" Version="5.1.4.129" />
|
<PackageReference Include="sqlSugarCore" Version="5.1.4.129" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -7609,6 +7609,76 @@
|
|||||||
修改时间
|
修改时间
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:CoreCms.Net.Model.Entities.CoreCmsAliPayUserInfo">
|
||||||
|
<summary>
|
||||||
|
支付宝用户信息
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Model.Entities.CoreCmsAliPayUserInfo.#ctor">
|
||||||
|
<summary>
|
||||||
|
构造函数
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Entities.CoreCmsAliPayUserInfo.id">
|
||||||
|
<summary>
|
||||||
|
序列
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Entities.CoreCmsAliPayUserInfo.accessToken">
|
||||||
|
<summary>
|
||||||
|
accessToken
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Entities.CoreCmsAliPayUserInfo.aliPayUserInfoId">
|
||||||
|
<summary>
|
||||||
|
支付宝用户编号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Entities.CoreCmsAliPayUserInfo.authStart">
|
||||||
|
<summary>
|
||||||
|
授权开始
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Entities.CoreCmsAliPayUserInfo.expiresIn">
|
||||||
|
<summary>
|
||||||
|
截止时间
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Entities.CoreCmsAliPayUserInfo.reExpiresIn">
|
||||||
|
<summary>
|
||||||
|
刷新令牌时间
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Entities.CoreCmsAliPayUserInfo.refreshToken">
|
||||||
|
<summary>
|
||||||
|
刷新后token
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Entities.CoreCmsAliPayUserInfo.userId">
|
||||||
|
<summary>
|
||||||
|
授权商户的user_id
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Entities.CoreCmsAliPayUserInfo.userInfoId">
|
||||||
|
<summary>
|
||||||
|
注册用户序列
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Entities.CoreCmsAliPayUserInfo.openId">
|
||||||
|
<summary>
|
||||||
|
openId
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Entities.CoreCmsAliPayUserInfo.unionId">
|
||||||
|
<summary>
|
||||||
|
unionId
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Entities.CoreCmsAliPayUserInfo.createTime">
|
||||||
|
<summary>
|
||||||
|
创建时间
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:CoreCms.Net.Model.Entities.CoreCmsLoginLog">
|
<member name="T:CoreCms.Net.Model.Entities.CoreCmsLoginLog">
|
||||||
<summary>
|
<summary>
|
||||||
登录日志
|
登录日志
|
||||||
@@ -9081,6 +9151,31 @@
|
|||||||
审核状态
|
审核状态
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:CoreCms.Net.Model.FromBody.FMAliLoginDecryptPhoneNumber">
|
||||||
|
<summary>
|
||||||
|
微信小程序登录解码手机号码
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.FromBody.FMAliLoginDecryptPhoneNumber.encryptedData">
|
||||||
|
<summary>
|
||||||
|
响应报文数据(待解码)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.FromBody.FMAliLoginDecryptPhoneNumber.sign">
|
||||||
|
<summary>
|
||||||
|
sign
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.FromBody.FMAliLoginDecryptPhoneNumber.sessionAuthId">
|
||||||
|
<summary>
|
||||||
|
支付宝用户序列(也是前端缓存的用户编码)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.FromBody.FMAliLoginDecryptPhoneNumber.invitecode">
|
||||||
|
<summary>
|
||||||
|
推荐码
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:CoreCms.Net.Model.FromBody.FMGetNewArticle">
|
<member name="T:CoreCms.Net.Model.FromBody.FMGetNewArticle">
|
||||||
<summary>
|
<summary>
|
||||||
获取新文章
|
获取新文章
|
||||||
@@ -10279,47 +10374,47 @@
|
|||||||
微信小程序登录解码手机号码
|
微信小程序登录解码手机号码
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="T:CoreCms.Net.Model.FromBody.FMWxAccountCreate">
|
<member name="T:CoreCms.Net.Model.FromBody.FMComAccountCreate">
|
||||||
<summary>
|
<summary>
|
||||||
微信账户创建
|
通用账户创建传输实体
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:CoreCms.Net.Model.FromBody.FMWxAccountCreate.password">
|
<member name="P:CoreCms.Net.Model.FromBody.FMComAccountCreate.password">
|
||||||
<summary>
|
<summary>
|
||||||
密码
|
密码
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:CoreCms.Net.Model.FromBody.FMWxAccountCreate.nickname">
|
<member name="P:CoreCms.Net.Model.FromBody.FMComAccountCreate.nickname">
|
||||||
<summary>
|
<summary>
|
||||||
昵称
|
昵称
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:CoreCms.Net.Model.FromBody.FMWxAccountCreate.avatar">
|
<member name="P:CoreCms.Net.Model.FromBody.FMComAccountCreate.avatar">
|
||||||
<summary>
|
<summary>
|
||||||
头像
|
头像
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:CoreCms.Net.Model.FromBody.FMWxAccountCreate.code">
|
<member name="P:CoreCms.Net.Model.FromBody.FMComAccountCreate.code">
|
||||||
<summary>
|
<summary>
|
||||||
短信验证码
|
短信验证码
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:CoreCms.Net.Model.FromBody.FMWxAccountCreate.mobile">
|
<member name="P:CoreCms.Net.Model.FromBody.FMComAccountCreate.mobile">
|
||||||
<summary>
|
<summary>
|
||||||
手机号码
|
手机号码
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:CoreCms.Net.Model.FromBody.FMWxAccountCreate.sessionAuthId">
|
<member name="P:CoreCms.Net.Model.FromBody.FMComAccountCreate.sessionAuthId">
|
||||||
<summary>
|
<summary>
|
||||||
微信小程序授权sessionAuthId
|
微信小程序授权sessionAuthId
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:CoreCms.Net.Model.FromBody.FMWxAccountCreate.platform">
|
<member name="P:CoreCms.Net.Model.FromBody.FMComAccountCreate.platform">
|
||||||
<summary>
|
<summary>
|
||||||
来源
|
来源
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:CoreCms.Net.Model.FromBody.FMWxAccountCreate.invitecode">
|
<member name="P:CoreCms.Net.Model.FromBody.FMComAccountCreate.invitecode">
|
||||||
<summary>
|
<summary>
|
||||||
推荐码
|
推荐码
|
||||||
</summary>
|
</summary>
|
||||||
@@ -10349,6 +10444,86 @@
|
|||||||
用户发起订阅提交
|
用户发起订阅提交
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:CoreCms.Net.Model.Options.AliPayOptions">
|
||||||
|
<summary>
|
||||||
|
支付宝配置信息数据
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Options.AliPayOptions.AppId">
|
||||||
|
<summary>
|
||||||
|
AppId
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Options.AliPayOptions.AppSecret">
|
||||||
|
<summary>
|
||||||
|
应用私钥
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Options.AliPayOptions.AliPublicKey">
|
||||||
|
<summary>
|
||||||
|
支付宝公钥
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Options.AliPayOptions.AppPublicKey">
|
||||||
|
<summary>
|
||||||
|
应用公钥
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Options.AliPayOptions.RedirectUrl">
|
||||||
|
<summary>
|
||||||
|
回调地址
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Options.AliPayOptions.AliAccessTokenRefresh">
|
||||||
|
<summary>
|
||||||
|
阿里访问令牌刷新
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Options.AliPayOptions.AppConnectUrl">
|
||||||
|
<summary>
|
||||||
|
oauth2授权地址
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Options.AliPayOptions.AppAuthToken">
|
||||||
|
<summary>
|
||||||
|
支付宝授权类型
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Options.AliPayOptions.AliPublicApi">
|
||||||
|
<summary>
|
||||||
|
支付宝通用接口地址
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Options.AliPayOptions.AliPayAppAuth">
|
||||||
|
<summary>
|
||||||
|
外部H5唤起支付宝客户端进行实名认证接口地址
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Options.AliPayOptions.AESKey">
|
||||||
|
<summary>
|
||||||
|
接口内容加密方式(AESKey)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:CoreCms.Net.Model.ViewModels.AliPay.AlipayEncryptDTO">
|
||||||
|
<summary>
|
||||||
|
支付宝拉取解码手机号码
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.ViewModels.AliPay.AlipayEncryptDTO.code">
|
||||||
|
<summary>
|
||||||
|
返回状态码
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.ViewModels.AliPay.AlipayEncryptDTO.msg">
|
||||||
|
<summary>
|
||||||
|
消息详情
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.ViewModels.AliPay.AlipayEncryptDTO.mobile">
|
||||||
|
<summary>
|
||||||
|
手机号码
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:CoreCms.Net.Model.ViewModels.Api.KuaiDi100ApiPostParam">
|
<member name="T:CoreCms.Net.Model.ViewModels.Api.KuaiDi100ApiPostParam">
|
||||||
<summary>
|
<summary>
|
||||||
快递100请求进行的参数封装实体
|
快递100请求进行的参数封装实体
|
||||||
|
|||||||
121
CoreCms.Net.Model/Entities/User/CoreCmsAliPayUserInfo.cs
Normal file
121
CoreCms.Net.Model/Entities/User/CoreCmsAliPayUserInfo.cs
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
/***********************************************************************
|
||||||
|
* Project: CoreCms
|
||||||
|
* ProjectName: 核心内容管理系统
|
||||||
|
* Web: https://www.corecms.net
|
||||||
|
* Author: 大灰灰
|
||||||
|
* Email: jianweie@163.com
|
||||||
|
* CreateTime: 2024/4/11 星期四 1:24:31
|
||||||
|
* Description: 暂无
|
||||||
|
***********************************************************************/
|
||||||
|
|
||||||
|
using SqlSugar;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace CoreCms.Net.Model.Entities
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 支付宝用户信息
|
||||||
|
/// </summary>
|
||||||
|
public partial class CoreCmsAliPayUserInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 构造函数
|
||||||
|
/// </summary>
|
||||||
|
public CoreCmsAliPayUserInfo()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 序列
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "序列")]
|
||||||
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||||
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
|
public System.Int32 id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// accessToken
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "accessToken")]
|
||||||
|
|
||||||
|
[StringLength(maximumLength: 50, ErrorMessage = "{0}不能超过{1}字")]
|
||||||
|
public System.String accessToken { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 支付宝用户编号
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "支付宝用户编号")]
|
||||||
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
|
[StringLength(maximumLength: 50, ErrorMessage = "{0}不能超过{1}字")]
|
||||||
|
public System.String aliPayUserInfoId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 授权开始
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "授权开始")]
|
||||||
|
|
||||||
|
[StringLength(maximumLength: 50, ErrorMessage = "{0}不能超过{1}字")]
|
||||||
|
public System.String authStart { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 截止时间
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "截止时间")]
|
||||||
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
|
public System.Int32 expiresIn { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 刷新令牌时间
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "刷新令牌时间")]
|
||||||
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
|
public System.Int32 reExpiresIn { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 刷新后token
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "刷新后token")]
|
||||||
|
|
||||||
|
[StringLength(maximumLength: 50, ErrorMessage = "{0}不能超过{1}字")]
|
||||||
|
public System.String refreshToken { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 授权商户的user_id
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "授权商户的user_id")]
|
||||||
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
|
[StringLength(maximumLength: 50, ErrorMessage = "{0}不能超过{1}字")]
|
||||||
|
public System.String userId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 注册用户序列
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "注册用户序列")]
|
||||||
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
|
public System.Int32 userInfoId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// openId
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "openId")]
|
||||||
|
|
||||||
|
[StringLength(maximumLength: 50, ErrorMessage = "{0}不能超过{1}字")]
|
||||||
|
public System.String openId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// unionId
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "unionId")]
|
||||||
|
|
||||||
|
[StringLength(maximumLength: 50, ErrorMessage = "{0}不能超过{1}字")]
|
||||||
|
public System.String unionId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "创建时间")]
|
||||||
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
|
public System.DateTime createTime { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
35
CoreCms.Net.Model/FromBody/FMAliPost.cs
Normal file
35
CoreCms.Net.Model/FromBody/FMAliPost.cs
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
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 FMAliLoginDecryptPhoneNumber
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 响应报文数据(待解码)
|
||||||
|
/// </summary>
|
||||||
|
public string encryptedData { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// sign
|
||||||
|
/// </summary>
|
||||||
|
public string sign { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 支付宝用户序列(也是前端缓存的用户编码)
|
||||||
|
/// </summary>
|
||||||
|
public string sessionAuthId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 推荐码
|
||||||
|
/// </summary>
|
||||||
|
public int invitecode { get; set; } = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -63,9 +63,9 @@ namespace CoreCms.Net.Model.FromBody
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 微信账户创建
|
/// 通用账户创建传输实体
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class FMWxAccountCreate
|
public class FMComAccountCreate
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 密码
|
/// 密码
|
||||||
|
|||||||
61
CoreCms.Net.Model/Options/AliPayOptions.cs
Normal file
61
CoreCms.Net.Model/Options/AliPayOptions.cs
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
|
namespace CoreCms.Net.Model.Options
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 支付宝配置信息数据
|
||||||
|
/// </summary>
|
||||||
|
public partial class AliPayOptions : IOptions<AliPayOptions>
|
||||||
|
{
|
||||||
|
AliPayOptions IOptions<AliPayOptions>.Value => this;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// AppId
|
||||||
|
/// </summary>
|
||||||
|
public string AppId { get; set; } = string.Empty;
|
||||||
|
/// <summary>
|
||||||
|
/// 应用私钥
|
||||||
|
/// </summary>
|
||||||
|
public string AppSecret { get; set; } = string.Empty;
|
||||||
|
/// <summary>
|
||||||
|
/// 支付宝公钥
|
||||||
|
/// </summary>
|
||||||
|
public string AliPublicKey { get; set; } = string.Empty;
|
||||||
|
/// <summary>
|
||||||
|
/// 应用公钥
|
||||||
|
/// </summary>
|
||||||
|
public string AppPublicKey { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 回调地址
|
||||||
|
/// </summary>
|
||||||
|
public string RedirectUrl { get; set; } = string.Empty;
|
||||||
|
/// <summary>
|
||||||
|
/// 阿里访问令牌刷新
|
||||||
|
/// </summary>
|
||||||
|
public string AliAccessTokenRefresh { get; set; } = string.Empty;
|
||||||
|
/// <summary>
|
||||||
|
/// oauth2授权地址
|
||||||
|
/// </summary>
|
||||||
|
public string AppConnectUrl { get; set; } = string.Empty;
|
||||||
|
/// <summary>
|
||||||
|
/// 支付宝授权类型
|
||||||
|
/// </summary>
|
||||||
|
public string AppAuthToken { get; set; } = string.Empty;
|
||||||
|
/// <summary>
|
||||||
|
/// 支付宝通用接口地址
|
||||||
|
/// </summary>
|
||||||
|
public string AliPublicApi { get; set; } = string.Empty;
|
||||||
|
/// <summary>
|
||||||
|
/// 外部H5唤起支付宝客户端进行实名认证接口地址
|
||||||
|
/// </summary>
|
||||||
|
public string AliPayAppAuth { get; set; } = string.Empty;
|
||||||
|
/// <summary>
|
||||||
|
/// 接口内容加密方式(AESKey)
|
||||||
|
/// </summary>
|
||||||
|
public string AESKey { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
30
CoreCms.Net.Model/ViewModels/AliPay/AlipayEncryptDTO.cs
Normal file
30
CoreCms.Net.Model/ViewModels/AliPay/AlipayEncryptDTO.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CoreCms.Net.Model.ViewModels.AliPay
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 支付宝拉取解码手机号码
|
||||||
|
/// </summary>
|
||||||
|
public class AlipayEncryptDTO
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 返回状态码
|
||||||
|
/// </summary>
|
||||||
|
public string code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 消息详情
|
||||||
|
/// </summary>
|
||||||
|
public string msg { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 手机号码
|
||||||
|
/// </summary>
|
||||||
|
public string mobile { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
208
CoreCms.Net.Repository/User/CoreCmsAliPayUserInfoRepository.cs
Normal file
208
CoreCms.Net.Repository/User/CoreCmsAliPayUserInfoRepository.cs
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
/***********************************************************************
|
||||||
|
* Project: CoreCms
|
||||||
|
* ProjectName: 核心内容管理系统
|
||||||
|
* Web: https://www.corecms.net
|
||||||
|
* Author: 大灰灰
|
||||||
|
* Email: jianweie@163.com
|
||||||
|
* CreateTime: 2024/4/11 星期四 1:24:31
|
||||||
|
* Description: 暂无
|
||||||
|
***********************************************************************/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq.Expressions;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using CoreCms.Net.Caching.Manual;
|
||||||
|
using CoreCms.Net.Configuration;
|
||||||
|
using CoreCms.Net.Model.Entities;
|
||||||
|
using CoreCms.Net.Model.ViewModels.Basics;
|
||||||
|
using CoreCms.Net.IRepository;
|
||||||
|
using CoreCms.Net.IRepository.UnitOfWork;
|
||||||
|
using CoreCms.Net.Model.ViewModels.UI;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace CoreCms.Net.Repository
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 支付宝用户信息 接口实现
|
||||||
|
/// </summary>
|
||||||
|
public class CoreCmsAliPayUserInfoRepository : BaseRepository<CoreCmsAliPayUserInfo>, ICoreCmsAliPayUserInfoRepository
|
||||||
|
{
|
||||||
|
private readonly IUnitOfWork _unitOfWork;
|
||||||
|
public CoreCmsAliPayUserInfoRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
|
||||||
|
{
|
||||||
|
_unitOfWork = unitOfWork;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 实现重写增删改查操作==========================================================
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写异步插入方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity">实体数据</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<AdminUiCallBack> InsertAsync(CoreCmsAliPayUserInfo entity)
|
||||||
|
{
|
||||||
|
var jm = new AdminUiCallBack();
|
||||||
|
|
||||||
|
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||||
|
jm.code = bl ? 0 : 1;
|
||||||
|
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||||
|
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写异步更新方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsAliPayUserInfo entity)
|
||||||
|
{
|
||||||
|
var jm = new AdminUiCallBack();
|
||||||
|
|
||||||
|
var oldModel = await DbClient.Queryable<CoreCmsAliPayUserInfo>().In(entity.id).SingleAsync();
|
||||||
|
if (oldModel == null)
|
||||||
|
{
|
||||||
|
jm.msg = "不存在此信息";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
//事物处理过程开始
|
||||||
|
oldModel.id = entity.id;
|
||||||
|
oldModel.accessToken = entity.accessToken;
|
||||||
|
oldModel.aliPayUserInfoId = entity.aliPayUserInfoId;
|
||||||
|
oldModel.authStart = entity.authStart;
|
||||||
|
oldModel.expiresIn = entity.expiresIn;
|
||||||
|
oldModel.reExpiresIn = entity.reExpiresIn;
|
||||||
|
oldModel.refreshToken = entity.refreshToken;
|
||||||
|
oldModel.userId = entity.userId;
|
||||||
|
oldModel.userInfoId = entity.userInfoId;
|
||||||
|
oldModel.openId = entity.openId;
|
||||||
|
oldModel.unionId = entity.unionId;
|
||||||
|
oldModel.createTime = entity.createTime;
|
||||||
|
|
||||||
|
//事物处理过程结束
|
||||||
|
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||||
|
jm.code = bl ? 0 : 1;
|
||||||
|
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||||
|
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写异步更新方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsAliPayUserInfo> entity)
|
||||||
|
{
|
||||||
|
var jm = new AdminUiCallBack();
|
||||||
|
|
||||||
|
var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync();
|
||||||
|
jm.code = bl ? 0 : 1;
|
||||||
|
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||||
|
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写删除指定ID的数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||||
|
{
|
||||||
|
var jm = new AdminUiCallBack();
|
||||||
|
|
||||||
|
var bl = await DbClient.Deleteable<CoreCmsAliPayUserInfo>(id).ExecuteCommandHasChangeAsync();
|
||||||
|
jm.code = bl ? 0 : 1;
|
||||||
|
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||||
|
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写删除指定ID集合的数据(批量删除)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ids"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||||
|
{
|
||||||
|
var jm = new AdminUiCallBack();
|
||||||
|
|
||||||
|
var bl = await DbClient.Deleteable<CoreCmsAliPayUserInfo>().In(ids).ExecuteCommandHasChangeAsync();
|
||||||
|
jm.code = bl ? 0 : 1;
|
||||||
|
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||||
|
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 重写根据条件查询分页数据
|
||||||
|
/// <summary>
|
||||||
|
/// 重写根据条件查询分页数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="predicate">判断集合</param>
|
||||||
|
/// <param name="orderByType">排序方式</param>
|
||||||
|
/// <param name="pageIndex">当前页面索引</param>
|
||||||
|
/// <param name="pageSize">分布大小</param>
|
||||||
|
/// <param name="orderByExpression"></param>
|
||||||
|
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<IPageList<CoreCmsAliPayUserInfo>> QueryPageAsync(Expression<Func<CoreCmsAliPayUserInfo, bool>> predicate,
|
||||||
|
Expression<Func<CoreCmsAliPayUserInfo, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||||
|
int pageSize = 20, bool blUseNoLock = false)
|
||||||
|
{
|
||||||
|
RefAsync<int> totalCount = 0;
|
||||||
|
List<CoreCmsAliPayUserInfo> page;
|
||||||
|
if (blUseNoLock)
|
||||||
|
{
|
||||||
|
page = await DbClient.Queryable<CoreCmsAliPayUserInfo>()
|
||||||
|
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||||
|
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsAliPayUserInfo
|
||||||
|
{
|
||||||
|
id = p.id,
|
||||||
|
accessToken = p.accessToken,
|
||||||
|
aliPayUserInfoId = p.aliPayUserInfoId,
|
||||||
|
authStart = p.authStart,
|
||||||
|
expiresIn = p.expiresIn,
|
||||||
|
reExpiresIn = p.reExpiresIn,
|
||||||
|
refreshToken = p.refreshToken,
|
||||||
|
userId = p.userId,
|
||||||
|
userInfoId = p.userInfoId,
|
||||||
|
openId = p.openId,
|
||||||
|
unionId = p.unionId,
|
||||||
|
createTime = p.createTime,
|
||||||
|
|
||||||
|
}).With(SqlWith.NoLock).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
page = await DbClient.Queryable<CoreCmsAliPayUserInfo>()
|
||||||
|
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||||
|
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsAliPayUserInfo
|
||||||
|
{
|
||||||
|
id = p.id,
|
||||||
|
accessToken = p.accessToken,
|
||||||
|
aliPayUserInfoId = p.aliPayUserInfoId,
|
||||||
|
authStart = p.authStart,
|
||||||
|
expiresIn = p.expiresIn,
|
||||||
|
reExpiresIn = p.reExpiresIn,
|
||||||
|
refreshToken = p.refreshToken,
|
||||||
|
userId = p.userId,
|
||||||
|
userInfoId = p.userInfoId,
|
||||||
|
openId = p.openId,
|
||||||
|
unionId = p.unionId,
|
||||||
|
createTime = p.createTime,
|
||||||
|
|
||||||
|
}).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||||
|
}
|
||||||
|
var list = new PageList<CoreCmsAliPayUserInfo>(page, pageIndex, pageSize, totalCount);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AlibabaCloud.SDK.Dysmsapi20170525" Version="2.0.24" />
|
<PackageReference Include="AlibabaCloud.SDK.Dysmsapi20170525" Version="2.0.24" />
|
||||||
|
<PackageReference Include="AlipaySDKNet.Standard" Version="4.9.78" />
|
||||||
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.13.0" />
|
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.13.0" />
|
||||||
<PackageReference Include="Essensoft.Paylink.Alipay" Version="4.1.3" />
|
<PackageReference Include="Essensoft.Paylink.Alipay" Version="4.1.3" />
|
||||||
<PackageReference Include="Essensoft.Paylink.WeChatPay" Version="4.1.3" />
|
<PackageReference Include="Essensoft.Paylink.WeChatPay" Version="4.1.3" />
|
||||||
|
|||||||
@@ -18,19 +18,19 @@ using System.Threading.Tasks;
|
|||||||
using NLog;
|
using NLog;
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
using CoreCms.Net.Model.Options;
|
||||||
using CoreCms.Net.Utility.Extensions;
|
using CoreCms.Net.Utility.Extensions;
|
||||||
using CoreCms.Net.Utility.Helper;
|
using CoreCms.Net.Utility.Helper;
|
||||||
using Essensoft.Paylink.Alipay;
|
using Essensoft.Paylink.Alipay;
|
||||||
using Essensoft.Paylink.Alipay.Domain;
|
using Essensoft.Paylink.Alipay.Domain;
|
||||||
using Essensoft.Paylink.Alipay.Request;
|
using Essensoft.Paylink.Alipay.Request;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Essensoft.Paylink.WeChatPay;
|
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using static Aliyun.OSS.Model.LiveChannelStat;
|
using Aop.Api;
|
||||||
using Essensoft.Paylink.WeChatPay.V2.Request;
|
using static SKIT.FlurlHttpClient.Wechat.Api.Models.WxaICPApplyICPFilingRequest.Types;
|
||||||
using Essensoft.Paylink.WeChatPay.V2;
|
using Microsoft.IdentityModel.Tokens;
|
||||||
using static SKIT.FlurlHttpClient.Wechat.Api.Models.ShopCouponGetResponse.Types.Result.Types.Coupon.Types.CouponDetail.Types.Discount.Types.DiscountCondidtion.Types;
|
|
||||||
|
|
||||||
namespace CoreCms.Net.Services
|
namespace CoreCms.Net.Services
|
||||||
{
|
{
|
||||||
@@ -42,17 +42,19 @@ namespace CoreCms.Net.Services
|
|||||||
private readonly IAlipayClient _client;
|
private readonly IAlipayClient _client;
|
||||||
private readonly IServiceProvider _serviceProvider;
|
private readonly IServiceProvider _serviceProvider;
|
||||||
private readonly IAlipayConfigServices _alipayConfigServices;
|
private readonly IAlipayConfigServices _alipayConfigServices;
|
||||||
|
private readonly AliPayOptions _options;
|
||||||
|
|
||||||
|
|
||||||
|
public AliPayServices(IWeChatPayRepository dal, IServiceProvider serviceProvider, IAlipayClient client, IAlipayConfigServices alipayConfigServices, IOptions<AliPayOptions> options)
|
||||||
public AliPayServices(IWeChatPayRepository dal, IServiceProvider serviceProvider, IAlipayClient client, IAlipayConfigServices alipayConfigServices)
|
|
||||||
{
|
{
|
||||||
_serviceProvider = serviceProvider;
|
_serviceProvider = serviceProvider;
|
||||||
_client = client;
|
_client = client;
|
||||||
_alipayConfigServices = alipayConfigServices;
|
_alipayConfigServices = alipayConfigServices;
|
||||||
|
_options = options.Value;
|
||||||
BaseDal = dal;
|
BaseDal = dal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region 发起支付宝支付
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 发起支付宝支付
|
/// 发起支付宝支付
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -63,7 +65,14 @@ namespace CoreCms.Net.Services
|
|||||||
var jm = new WebApiCallBack();
|
var jm = new WebApiCallBack();
|
||||||
using var container = _serviceProvider.CreateScope();
|
using var container = _serviceProvider.CreateScope();
|
||||||
var billPaymentsServices = container.ServiceProvider.GetService<ICoreCmsBillPaymentsServices>();
|
var billPaymentsServices = container.ServiceProvider.GetService<ICoreCmsBillPaymentsServices>();
|
||||||
//var payment = await billPaymentsServices.QueryByClauseAsync(p => p.paymentId == entity.paymentId);
|
var _aliPayUserInfoServices = container.ServiceProvider.GetService<ICoreCmsAliPayUserInfoServices>();
|
||||||
|
|
||||||
|
var aliUserInfo = await _aliPayUserInfoServices.QueryByClauseAsync(p => p.userInfoId == entity.userId);
|
||||||
|
if (aliUserInfo == null)
|
||||||
|
{
|
||||||
|
jm.msg = "支付宝下单用户获取失败";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
var tradeType = GlobalEnumVars.AliPayPayTradeType.ScanQRCodes.ToString();
|
var tradeType = GlobalEnumVars.AliPayPayTradeType.ScanQRCodes.ToString();
|
||||||
if (!string.IsNullOrEmpty(entity.parameters))
|
if (!string.IsNullOrEmpty(entity.parameters))
|
||||||
@@ -73,8 +82,6 @@ namespace CoreCms.Net.Services
|
|||||||
tradeType = PayHelper.GetAliPayPayTradeType(value.ObjectToString());
|
tradeType = PayHelper.GetAliPayPayTradeType(value.ObjectToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var config = await _alipayConfigServices.QueryByClauseAsync(p => p.isDefault == true && p.isEnable == true && p.appType == tradeType);
|
var config = await _alipayConfigServices.QueryByClauseAsync(p => p.isDefault == true && p.isEnable == true && p.appType == tradeType);
|
||||||
if (config == null)
|
if (config == null)
|
||||||
{
|
{
|
||||||
@@ -90,7 +97,6 @@ namespace CoreCms.Net.Services
|
|||||||
|
|
||||||
var notifyUrl = config.notifyUrl.EndsWith("/") ? config.notifyUrl + "m-" + config.appId : config.notifyUrl + "/m-" + config.appId;
|
var notifyUrl = config.notifyUrl.EndsWith("/") ? config.notifyUrl + "m-" + config.appId : config.notifyUrl + "/m-" + config.appId;
|
||||||
|
|
||||||
|
|
||||||
//构建linkPay请求配置实体
|
//构建linkPay请求配置实体
|
||||||
var payOptions = new AlipayOptions
|
var payOptions = new AlipayOptions
|
||||||
{
|
{
|
||||||
@@ -132,30 +138,43 @@ namespace CoreCms.Net.Services
|
|||||||
jm.status = !response.IsError;
|
jm.status = !response.IsError;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//支付宝小程序支付
|
||||||
else if (tradeType == GlobalEnumVars.AliPayPayTradeType.JSAPI.ToString())
|
else if (tradeType == GlobalEnumVars.AliPayPayTradeType.JSAPI.ToString())
|
||||||
{
|
{
|
||||||
var model = new AlipayTradePagePayModel
|
Aop.Api.IAopClient alipayClient = new Aop.Api.DefaultAopClient(_options.AliPublicApi, _options.AppId, _options.AppSecret, "json", "1.0", "RSA2", _options.AliPublicKey, "utf-8", false);
|
||||||
|
|
||||||
|
Aop.Api.Request.AlipayTradeCreateRequest request = new Aop.Api.Request.AlipayTradeCreateRequest();
|
||||||
|
Aop.Api.Domain.AlipayTradeCreateModel model = new Aop.Api.Domain.AlipayTradeCreateModel();
|
||||||
|
model.OutTradeNo = entity.paymentId;
|
||||||
|
model.TotalAmount = entity.money.ToString(CultureInfo.InvariantCulture);
|
||||||
|
model.Subject = entity.payTitle.Length > 40 ? entity.payTitle[..40] : entity.payTitle;
|
||||||
|
model.ProductCode = "JSAPI_PAY";
|
||||||
|
model.OpAppId = _options.AppId;
|
||||||
|
model.Body = entity.payTitle.Length > 40 ? entity.payTitle[..40] : entity.payTitle;
|
||||||
|
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(aliUserInfo.userId))
|
||||||
{
|
{
|
||||||
OutTradeNo = entity.paymentId,
|
model.BuyerId = aliUserInfo.userId;
|
||||||
Subject = entity.payTitle.Length > 40 ? entity.payTitle[..40] : entity.payTitle,
|
}
|
||||||
ProductCode = "JSAPI_PAY",
|
if (!string.IsNullOrEmpty(aliUserInfo.openId))
|
||||||
TotalAmount = entity.money.ToString(CultureInfo.InvariantCulture),
|
{
|
||||||
Body = entity.payTitle.Length > 40 ? entity.payTitle[..40] : entity.payTitle
|
model.OpBuyerOpenId = aliUserInfo.openId;
|
||||||
|
}
|
||||||
|
request.SetBizModel(model);
|
||||||
|
request.SetNotifyUrl(notifyUrl);
|
||||||
|
|
||||||
|
Aop.Api.Response.AlipayTradeCreateResponse response = alipayClient.Execute(request);
|
||||||
|
|
||||||
|
jm.data = new
|
||||||
|
{
|
||||||
|
entity.paymentId,
|
||||||
|
response.TradeNo
|
||||||
};
|
};
|
||||||
var req = new AlipayTradePagePayRequest();
|
|
||||||
req.SetBizModel(model);
|
|
||||||
req.SetNotifyUrl(notifyUrl);
|
|
||||||
//req.SetReturnUrl(config.jumpUrl);
|
|
||||||
|
|
||||||
Loging.NLogUtil.WriteAll(NLog.LogLevel.Trace, Loging.LogType.Order, "支付宝JSAPI支付拼接支付宝小程序入参", JsonConvert.SerializeObject(model));
|
|
||||||
var response = await _client.PageExecuteAsync(req, payOptions);
|
|
||||||
Loging.NLogUtil.WriteAll(NLog.LogLevel.Trace, Loging.LogType.Order, "支付宝JSAPI支付返回数据", JsonConvert.SerializeObject(response));
|
|
||||||
|
|
||||||
jm.data = response.Body;
|
|
||||||
//response.TradeNo = entity.paymentId;
|
|
||||||
jm.otherData = response;
|
jm.otherData = response;
|
||||||
jm.status = !response.IsError;
|
jm.status = !response.IsError;
|
||||||
|
jm.msg = response.IsError ? response.SubMsg : "支付宝小程序支付参数构建成功。";
|
||||||
|
|
||||||
}
|
}
|
||||||
//PC网站支付
|
//PC网站支付
|
||||||
else if (tradeType == GlobalEnumVars.AliPayPayTradeType.JSAPI_PC.ToString())
|
else if (tradeType == GlobalEnumVars.AliPayPayTradeType.JSAPI_PC.ToString())
|
||||||
@@ -179,7 +198,7 @@ namespace CoreCms.Net.Services
|
|||||||
|
|
||||||
|
|
||||||
jm.data = response.Body;
|
jm.data = response.Body;
|
||||||
//response.TradeNo = entity.paymentId;
|
response.TradeNo = entity.paymentId;
|
||||||
jm.otherData = response;
|
jm.otherData = response;
|
||||||
jm.status = !response.IsError;
|
jm.status = !response.IsError;
|
||||||
|
|
||||||
@@ -245,8 +264,9 @@ namespace CoreCms.Net.Services
|
|||||||
return jm;
|
return jm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 用户退款
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户退款
|
/// 用户退款
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -315,6 +335,47 @@ namespace CoreCms.Net.Services
|
|||||||
return jm;
|
return jm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 换取授权访问令牌(alipay.system.oauth.token)
|
||||||
|
/// <summary>
|
||||||
|
/// 根据票据返回app_auth_token相关信息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="code">票据</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Aop.Api.Response.AlipaySystemOauthTokenResponse GetAliPayAppAuthTokenBYCode(string code)
|
||||||
|
{
|
||||||
|
Aop.Api.IAopClient alipayClient = new Aop.Api.DefaultAopClient(_options.AliPublicApi, _options.AppId, _options.AppSecret, "json", "1.0", "RSA2", _options.AliPublicKey, "utf-8", false);
|
||||||
|
|
||||||
|
Aop.Api.Request.AlipaySystemOauthTokenRequest request = new Aop.Api.Request.AlipaySystemOauthTokenRequest();
|
||||||
|
|
||||||
|
request.GrantType = "authorization_code";
|
||||||
|
request.Code = code;
|
||||||
|
request.RefreshToken = _options.AliAccessTokenRefresh;
|
||||||
|
|
||||||
|
Aop.Api.Response.AlipaySystemOauthTokenResponse response = alipayClient.Execute(request);
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 支付宝会员授权信息查询接口(alipay.user.info.share)
|
||||||
|
/// <summary>
|
||||||
|
/// 根据Token返回支付宝用户基本信息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="token">Token</param>
|
||||||
|
public Aop.Api.Response.AlipayUserInfoShareResponse GetAliPayUserInfoByToken(string token)
|
||||||
|
{
|
||||||
|
Aop.Api.IAopClient alipayClient = new Aop.Api.DefaultAopClient(_options.AliPublicApi, _options.AppId, _options.AppSecret, "json", "1.0", "RSA2", _options.AliPublicKey, "utf-8", false);
|
||||||
|
|
||||||
|
Aop.Api.Request.AlipayUserInfoShareRequest request = new Aop.Api.Request.AlipayUserInfoShareRequest();
|
||||||
|
Aop.Api.Response.AlipayUserInfoShareResponse response = alipayClient.Execute(request, token);
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
116
CoreCms.Net.Services/User/CoreCmsAliPayUserInfoServices.cs
Normal file
116
CoreCms.Net.Services/User/CoreCmsAliPayUserInfoServices.cs
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
/***********************************************************************
|
||||||
|
* Project: CoreCms
|
||||||
|
* ProjectName: 核心内容管理系统
|
||||||
|
* Web: https://www.corecms.net
|
||||||
|
* Author: 大灰灰
|
||||||
|
* Email: jianweie@163.com
|
||||||
|
* CreateTime: 2024/4/10 星期三 22:28:09
|
||||||
|
* Description: 暂无
|
||||||
|
***********************************************************************/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq.Expressions;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using CoreCms.Net.Configuration;
|
||||||
|
using CoreCms.Net.IRepository;
|
||||||
|
using CoreCms.Net.IRepository.UnitOfWork;
|
||||||
|
using CoreCms.Net.IServices;
|
||||||
|
using CoreCms.Net.Model.Entities;
|
||||||
|
using CoreCms.Net.Model.ViewModels.Basics;
|
||||||
|
using CoreCms.Net.Model.ViewModels.UI;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
|
||||||
|
namespace CoreCms.Net.Services
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 支付宝用户信息 接口实现
|
||||||
|
/// </summary>
|
||||||
|
public class CoreCmsAliPayUserInfoServices : BaseServices<CoreCmsAliPayUserInfo>, ICoreCmsAliPayUserInfoServices
|
||||||
|
{
|
||||||
|
private readonly ICoreCmsAliPayUserInfoRepository _dal;
|
||||||
|
private readonly IUnitOfWork _unitOfWork;
|
||||||
|
|
||||||
|
public CoreCmsAliPayUserInfoServices(IUnitOfWork unitOfWork, ICoreCmsAliPayUserInfoRepository dal)
|
||||||
|
{
|
||||||
|
this._dal = dal;
|
||||||
|
base.BaseDal = dal;
|
||||||
|
_unitOfWork = unitOfWork;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 实现重写增删改查操作==========================================================
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写异步插入方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity">实体数据</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<AdminUiCallBack> InsertAsync(CoreCmsAliPayUserInfo entity)
|
||||||
|
{
|
||||||
|
return await _dal.InsertAsync(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写异步更新方法方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsAliPayUserInfo entity)
|
||||||
|
{
|
||||||
|
return await _dal.UpdateAsync(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写异步更新方法方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsAliPayUserInfo> entity)
|
||||||
|
{
|
||||||
|
return await _dal.UpdateAsync(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写删除指定ID的数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||||
|
{
|
||||||
|
return await _dal.DeleteByIdAsync(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写删除指定ID集合的数据(批量删除)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ids"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||||
|
{
|
||||||
|
return await _dal.DeleteByIdsAsync(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 重写根据条件查询分页数据
|
||||||
|
/// <summary>
|
||||||
|
/// 重写根据条件查询分页数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="predicate">判断集合</param>
|
||||||
|
/// <param name="orderByType">排序方式</param>
|
||||||
|
/// <param name="pageIndex">当前页面索引</param>
|
||||||
|
/// <param name="pageSize">分布大小</param>
|
||||||
|
/// <param name="orderByExpression"></param>
|
||||||
|
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<IPageList<CoreCmsAliPayUserInfo>> QueryPageAsync(Expression<Func<CoreCmsAliPayUserInfo, bool>> predicate,
|
||||||
|
Expression<Func<CoreCmsAliPayUserInfo, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||||
|
int pageSize = 20, bool blUseNoLock = false)
|
||||||
|
{
|
||||||
|
return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -571,7 +571,7 @@ public class CoreCmsUserServices : BaseServices<CoreCmsUser>, ICoreCmsUserServic
|
|||||||
/// <param name="loginType">登录方式(1普通,2短信,3微信小程序拉取手机号)</param>
|
/// <param name="loginType">登录方式(1普通,2短信,3微信小程序拉取手机号)</param>
|
||||||
/// <param name="platform"></param>
|
/// <param name="platform"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<WebApiCallBack> SmsLogin(FMWxAccountCreate entity,
|
public async Task<WebApiCallBack> SmsLogin(FMComAccountCreate entity,
|
||||||
int loginType = (int)GlobalEnumVars.LoginType.WeChatPhoneNumber,
|
int loginType = (int)GlobalEnumVars.LoginType.WeChatPhoneNumber,
|
||||||
int platform = (int)GlobalEnumVars.CoreShopSystemCategory.Api)
|
int platform = (int)GlobalEnumVars.CoreShopSystemCategory.Api)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -428,7 +428,10 @@ const install = (Vue, vm) => {
|
|||||||
let submitInvoiceApply = (params, config = {}) => http.post('/Api/Order/SubmitInvoiceApply', params, { custom: { methodName: 'order.submitInvoiceApply', needToken: true } });
|
let submitInvoiceApply = (params, config = {}) => http.post('/Api/Order/SubmitInvoiceApply', params, { custom: { methodName: 'order.submitInvoiceApply', needToken: true } });
|
||||||
|
|
||||||
|
|
||||||
|
//支付宝解析code
|
||||||
|
let getAliPayAppAuthTokenBYCode = (params, config = {}) => http.post('/Api/AliPayAuth/getAliPayAppAuthTokenBYCode', params, { custom: { methodName: 'user.GetAliPayAppAuthTokenByCode', needToken: false } });
|
||||||
|
//支付宝小程序手机授权(拉取手机号码)
|
||||||
|
let loginByGetPhoneNumberForAli = (params, config = {}) => http.post('/Api/User/DecryptPhoneNumberByAli', params, { custom: { methodName: 'user.loginByGetPhoneNumberForAli', needToken: false } });
|
||||||
|
|
||||||
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
|
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
|
||||||
vm.$u.api = {
|
vm.$u.api = {
|
||||||
@@ -632,7 +635,10 @@ const install = (Vue, vm) => {
|
|||||||
uploadFilesFByBase64,
|
uploadFilesFByBase64,
|
||||||
getPromotionList,
|
getPromotionList,
|
||||||
checkInvoice,
|
checkInvoice,
|
||||||
submitInvoiceApply
|
submitInvoiceApply,
|
||||||
|
|
||||||
|
getAliPayAppAuthTokenBYCode,
|
||||||
|
loginByGetPhoneNumberForAli
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
}"
|
}"
|
||||||
:style="{ 'background-color': styles.buttonColor }"
|
:style="{ 'background-color': styles.buttonColor }"
|
||||||
@click="open">
|
@click="open">
|
||||||
<image class="icon icon-jia" src="/static/images/common/menu.png" mode="" :class="{ active: showContent }"></image>
|
<image class="icon icon-jia" src="/static/images/common/menu.png" mode="aspectFit" :class="{ active: showContent }"></image>
|
||||||
<!-- <text class="icon icon-jia" :class="{ active: showContent }"></text> -->
|
<!-- <text class="icon icon-jia" :class="{ active: showContent }"></text> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="fab-content"
|
<view class="fab-content"
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
@click="taps(index, item)">
|
@click="taps(index, item)">
|
||||||
<image class="content-image icon"
|
<image class="content-image icon"
|
||||||
:src="item.active ? item.selectedIconPath : item.iconPath"
|
:src="item.active ? item.selectedIconPath : item.iconPath"
|
||||||
mode=""></image>
|
mode="aspectFit"></image>
|
||||||
<text class="text">{{ item.text }}</text>
|
<text class="text">{{ item.text }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="flexDirectionEnd || horizontalRight" class="fab-item first"></view>
|
<view v-if="flexDirectionEnd || horizontalRight" class="fab-item first"></view>
|
||||||
|
|||||||
@@ -36,3 +36,6 @@
|
|||||||
.noCaptcha { display: block; }
|
.noCaptcha { display: block; }
|
||||||
.regain { display: block; }
|
.regain { display: block; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.aliGetNumberButton { height: 40px; position: relative; -webkit-box-align: center; -webkit-align-items: center; align-items: center; -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center; display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-orient: horizontal; -webkit-box-direction: normal; -webkit-flex-direction: row; flex-direction: row; box-sizing: border-box; flex-direction: row; padding: 0 12px; font-size: 14px; color: #fff; background-color: #5ac725; border-color: #5ac725; border-width: 1px; border-style: solid; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; }
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<u-toast ref="uToast" />
|
<u-toast ref="uToast" />
|
||||||
<!-- #ifndef MP-WEIXIN -->
|
<!-- #ifndef MP-WEIXIN || MP-ALIPAY -->
|
||||||
<u-popup class="coreshop-bottom-popup-box" :show="showLogin && sessionAuthIdTool" @close="hideModal" mode="bottom" :closeable="true">
|
<u-popup class="coreshop-bottom-popup-box" :show="showLogin && sessionAuthIdTool" @close="hideModal" mode="bottom" :closeable="true">
|
||||||
<view class="radius coreshop-bg-white wrap">
|
<view class="radius coreshop-bg-white wrap">
|
||||||
<view v-if="!showCodeBox">
|
<view v-if="!showCodeBox">
|
||||||
@@ -40,6 +40,54 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
<!-- #ifdef MP-ALIPAY -->
|
||||||
|
<u-popup class="coreshop-bottom-popup-box" :show="showLogin && sessionAuthIdTool" @close="hideModal" mode="center">
|
||||||
|
<view class="radius coreshop-bg-white">
|
||||||
|
<view class="modal-box">
|
||||||
|
<view class="modal-box-detail-detail">
|
||||||
|
<view class="shopDesc">
|
||||||
|
<view class="coreshop-avatar sm round margin-left">
|
||||||
|
<u--image width="24px" height="24px" :src="shopLogo"></u--image>
|
||||||
|
</view>
|
||||||
|
<text class="shopName">
|
||||||
|
{{shopName||'登录授权'}}
|
||||||
|
</text>
|
||||||
|
<text class="get">
|
||||||
|
申请
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<view class="modal-box-detail-title3">获取以下权限为您提供服务</view>
|
||||||
|
<view class="modal-box-detail-desc">
|
||||||
|
1、获取你的手机号提供更好的账户安全,物流,订单状态提醒等服务(在接下来微信授权手机号的弹窗中选择“允许”)<br />
|
||||||
|
2、使用我们的相关服务,需要将您的手机号授权给我们。
|
||||||
|
</view>
|
||||||
|
<!--服务协议-->
|
||||||
|
<view class="coreshop-margin-top-15 coreshop-margin-bottom-30 agreement-checked-view">
|
||||||
|
<u-checkbox-group>
|
||||||
|
<u-checkbox v-model="agreement" :checked="agreement" @change="checkboxChange" size="20" active-color="#19be6b"></u-checkbox>
|
||||||
|
</u-checkbox-group>
|
||||||
|
<view class="coreshop-text-black-view">
|
||||||
|
<text class="coreshop-text-black">同意</text>
|
||||||
|
<text class="text-blue" @tap="goUserAgreementPage">《服务协议》</text>
|
||||||
|
<text class="coreshop-text-black">与</text>
|
||||||
|
<text class="text-blue" @tap="goUserPrivacyPolicy">《隐私协议》</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="coreshop-flex coreshop-justify-between coreshop-padding-left-15 coreshop-padding-right-15">
|
||||||
|
<view class="coreshop-padding-5">
|
||||||
|
<u-button @click="closeAuth">暂不授权</u-button>
|
||||||
|
</view>
|
||||||
|
<view class="coreshop-padding-5">
|
||||||
|
<u-button type="success" :disabled="isDisabled" v-if="isDisabled">确定授权</u-button>
|
||||||
|
<!--<u-button type="success" open-type="getAuthorize" scope="phoneNumber" @getphonenumber="getAliPhoneNumber" v-else>确定授权</u-button>-->
|
||||||
|
<button class="aliGetNumberButton" open-type="getAuthorize" scope="phoneNumber" @getAuthorize="getAliPhoneNumber" v-else>确定授权</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
|
<!-- #endif -->
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<u-popup class="coreshop-bottom-popup-box" :show="showLogin && sessionAuthIdTool" @close="hideModal" mode="center">
|
<u-popup class="coreshop-bottom-popup-box" :show="showLogin && sessionAuthIdTool" @close="hideModal" mode="center">
|
||||||
<view class="radius coreshop-bg-white">
|
<view class="radius coreshop-bg-white">
|
||||||
@@ -195,28 +243,21 @@
|
|||||||
const _this = this
|
const _this = this
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
var userInfo = this.$store.state.userInfo;
|
var userInfo = this.$store.state.userInfo;
|
||||||
//var token = this.$db.get('userToken');
|
if (Object.keys(userInfo).length == 0) {
|
||||||
if (Object.keys(userInfo).length != 0) {
|
|
||||||
//console.log("获取到store.state用户数据");
|
|
||||||
} else {
|
|
||||||
_this.$store.commit('userInfo', "");
|
_this.$store.commit('userInfo', "");
|
||||||
_this.doToken();
|
_this.doWeChatToken();
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
var userInfo = this.$store.state.userInfo;
|
||||||
|
if (Object.keys(userInfo).length == 0) {
|
||||||
|
_this.$store.commit('userInfo', "");
|
||||||
|
_this.doAliPayToken();
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
},
|
},
|
||||||
//watch: {
|
|
||||||
// 'hasLogin': {
|
|
||||||
// handler(newVal) {
|
|
||||||
// //console.log(newVal);
|
|
||||||
// if (newVal == false) {
|
|
||||||
// //console.log("watch监听");
|
|
||||||
// this.doToken();
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// deep: true,
|
|
||||||
// immediate: true,
|
|
||||||
// }
|
|
||||||
//},
|
|
||||||
onShow() {
|
onShow() {
|
||||||
let _this = this;
|
let _this = this;
|
||||||
_this.timer = parseInt(_this.$db.get('timer'));
|
_this.timer = parseInt(_this.$db.get('timer'));
|
||||||
@@ -342,15 +383,37 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
doWeChatToken() {
|
||||||
doToken() {
|
|
||||||
const _this = this
|
const _this = this
|
||||||
//console.log("重新获取用户数据");
|
|
||||||
_this.getCode(function (code) {
|
_this.getCode(function (code) {
|
||||||
var data = {
|
let data = {
|
||||||
code: code
|
code: code
|
||||||
}
|
}
|
||||||
_this.$u.api.onLogin(data).then(res => {
|
_this.$u.api.onLogin(data).then(res => {
|
||||||
|
if (res.status) {
|
||||||
|
if (res.data.auth) {
|
||||||
|
_this.$db.set('userToken', res.data.auth.token)
|
||||||
|
_this.$store.commit('hasLogin', true);
|
||||||
|
}
|
||||||
|
if (res.data.user) {
|
||||||
|
_this.$store.commit('userInfo', res.data.user);
|
||||||
|
}
|
||||||
|
_this.sessionAuthIdTool = res.otherData;
|
||||||
|
} else {
|
||||||
|
_this.$u.toast(res.msg);
|
||||||
|
_this.$store.commit('userInfo', "");
|
||||||
|
_this.sessionAuthIdTool = res.otherData;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
doAliPayToken() {
|
||||||
|
const _this = this
|
||||||
|
_this.getCode(function (code) {
|
||||||
|
let data = {
|
||||||
|
id: code
|
||||||
|
}
|
||||||
|
_this.$u.api.getAliPayAppAuthTokenBYCode(data).then(res => {
|
||||||
if (res.status) {
|
if (res.status) {
|
||||||
if (res.data.auth) {
|
if (res.data.auth) {
|
||||||
_this.$db.set('userToken', res.data.auth.token)
|
_this.$db.set('userToken', res.data.auth.token)
|
||||||
@@ -378,7 +441,7 @@
|
|||||||
} else {
|
} else {
|
||||||
this.isDisabled = true;
|
this.isDisabled = true;
|
||||||
}
|
}
|
||||||
console.log(this.agreement);
|
//console.log(this.agreement);
|
||||||
},
|
},
|
||||||
// 隐藏登录弹窗
|
// 隐藏登录弹窗
|
||||||
hideModal() {
|
hideModal() {
|
||||||
@@ -396,21 +459,16 @@
|
|||||||
},
|
},
|
||||||
getCode: function (callback) {
|
getCode: function (callback) {
|
||||||
let _this = this
|
let _this = this
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
uni.login({
|
uni.login({
|
||||||
// #ifdef MP-ALIPAY
|
|
||||||
scopes: 'auth_user',
|
|
||||||
// #endif
|
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
//console.log(res);
|
|
||||||
if (res.code) {
|
if (res.code) {
|
||||||
return callback(res.code)
|
return callback(res.code)
|
||||||
} else {
|
} else {
|
||||||
//login成功,但是没有取到code
|
|
||||||
_this.$refs.uToast.show({ message: '未取得code,请重试', type: 'error', })
|
_this.$refs.uToast.show({ message: '未取得code,请重试', type: 'error', })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail: function (res) {
|
fail: function (res) {
|
||||||
//console.log(res);
|
|
||||||
var scene = this.$store.state.scene;
|
var scene = this.$store.state.scene;
|
||||||
//判断是否为 朋友圈内打开“单页模式",单页模式下,数据交互无法执行。所以不进行提醒
|
//判断是否为 朋友圈内打开“单页模式",单页模式下,数据交互无法执行。所以不进行提醒
|
||||||
if (scene != 1154) {
|
if (scene != 1154) {
|
||||||
@@ -418,6 +476,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
my.getAuthCode({
|
||||||
|
scopes: 'auth_user',
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res);
|
||||||
|
return callback(res.authCode)
|
||||||
|
},
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
|
||||||
},
|
},
|
||||||
toLogin: function (data) {
|
toLogin: function (data) {
|
||||||
let _this = this
|
let _this = this
|
||||||
@@ -470,9 +540,60 @@
|
|||||||
_this.agreement = false;
|
_this.agreement = false;
|
||||||
_this.isDisabled = true;
|
_this.isDisabled = true;
|
||||||
_this.showLogin = false;
|
_this.showLogin = false;
|
||||||
console.log(e.mp.detail.errMsg);
|
//console.log(e.mp.detail.errMsg);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
async getAliPhoneNumber() {
|
||||||
|
let _this = this
|
||||||
|
if (_this.agreement == false) {
|
||||||
|
_this.$refs.uToast.show({ message: '请先勾选并同意服务', type: 'error', })
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
my.getPhoneNumber({
|
||||||
|
success: (res) => {
|
||||||
|
console.log('获取手机号码', res);
|
||||||
|
let encryptedData = JSON.parse(res.response);
|
||||||
|
console.log('获取手机号码2', encryptedData);
|
||||||
|
var data = {
|
||||||
|
sessionAuthId: _this.sessionAuthIdTool,
|
||||||
|
sign: encryptedData.sign,
|
||||||
|
encryptedData: encryptedData.response,
|
||||||
|
}
|
||||||
|
//有推荐码的话,带上
|
||||||
|
var invitecode = _this.$db.get('invitecode')
|
||||||
|
if (invitecode) {
|
||||||
|
data.invitecode = invitecode
|
||||||
|
}
|
||||||
|
_this.$u.api.loginByGetPhoneNumberForAli(data).then(res => {
|
||||||
|
console.log(res);
|
||||||
|
if (res.status) {
|
||||||
|
//判断是否返回了token,如果没有,就说明没有绑定账号,跳转到绑定页面
|
||||||
|
if (res.data.token) {
|
||||||
|
//console.log("登陆成功,设置token,并返回上一页");
|
||||||
|
//登陆成功,设置token,并返回上一页
|
||||||
|
_this.$db.set('userToken', res.data.token)
|
||||||
|
_this.$store.commit('hasLogin', true);
|
||||||
|
_this.showLogin = false;
|
||||||
|
_this.$refs.uToast.show({ message: '登录成功', type: 'success', })
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
} else if (!res.status && res.code == 500) {
|
||||||
|
_this.$u.route({ type: 'switchTab', url: '/pages/index/default/default' });
|
||||||
|
} else {
|
||||||
|
_this.$u.toast('登录失败,请重试')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: (res) => {
|
||||||
|
console.log(res);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
_this.agreement = false;
|
||||||
|
_this.isDisabled = true;
|
||||||
|
_this.showLogin = false;
|
||||||
|
|
||||||
|
}
|
||||||
},
|
},
|
||||||
//实际的去登陆
|
//实际的去登陆
|
||||||
toGetPhoneNumber: function (data) {
|
toGetPhoneNumber: function (data) {
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
.ad-img { width: 100%; float: left; }
|
.ad-img { width: 100%; float: left; }
|
||||||
.ad-img:last-child { margin-bottom: 0; }
|
.ad-img:last-child { margin-bottom: 0; }
|
||||||
.imgup-btn { position: absolute; z-index: 1; bottom: 10px; width: 100%; min-height: 30px; text-align: center;
|
.imgup-btn { position: absolute; z-index: 1; bottom: 10px; width: 100%; min-height: 30px; text-align: center;
|
||||||
.coreshop-btn { line-height: 2; font-size: 14px; padding: 0 25px; border-radius: 25px; }
|
.coreshop-btn { font-size: 14px; padding: 0 25px; border-radius: 25px; height: 70rpx;line-height: 70rpx; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
<u-grid :col="limit" :border="false">
|
<u-grid :col="limit" :border="false">
|
||||||
<u-grid-item v-for="(item, index) in ListData" :key="index" @click="showSliderInfo(item.linkType, item.linkValue)">
|
<u-grid-item v-for="(item, index) in ListData" :key="index" @click="showSliderInfo(item.linkType, item.linkValue)">
|
||||||
<view class="coreshop-padding-bottom-10 coreshop-padding-top-10">
|
<view class="coreshop-padding-bottom-10 coreshop-padding-top-10">
|
||||||
<u-icon :name="item.image" width="50" height="50" :label="item.text" :labelSize="13" labelPos="bottom" :top="25" space="10"></u-icon>
|
<u-image class="show coreshop-margin-auto" width="100rpx" height="100rpx" :src="item.image"></u-image>
|
||||||
|
<u-icon :label="item.text" :labelSize="13" labelPos="bottom" :top="25" space="10"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</u-grid-item>
|
</u-grid-item>
|
||||||
</u-grid>
|
</u-grid>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<view class="tab-box coreshop-flex coreshop-align-center">
|
<view class="tab-box coreshop-flex coreshop-align-center">
|
||||||
<view class="tab-item" @tap="onTab(tab.id,tab.status)" :class="{ 'tab-active': tabCurrent === tab.id }" v-for="tab in tabList" :key="tab.id">
|
<view class="tab-item" @tap="onTab(tab.id,tab.status)" :class="{ 'tab-active': tabCurrent === tab.id }" v-for="tab in tabList" :key="tab.id">
|
||||||
<text class="tab-title">{{ tab.title }}</text>
|
<text class="tab-title">{{ tab.title }}</text>
|
||||||
<text v-show="tabCurrent === tab.id" class="tab-triangle"></text>
|
<text v-if="tabCurrent === tab.id" class="tab-triangle"></text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="content-box">
|
<view class="content-box">
|
||||||
|
|||||||
@@ -15,17 +15,19 @@
|
|||||||
|
|
||||||
<!--商家及推荐-->
|
<!--商家及推荐-->
|
||||||
<view class="coreshop-margin-20 coreshop-goods-shop-info-view-box">
|
<view class="coreshop-margin-20 coreshop-goods-shop-info-view-box">
|
||||||
<view class="coreshop-shop-view">
|
<view class="coreshop-display-flex coreshop-align-center ">
|
||||||
<view class="coreshop-position-absolute">
|
<view>
|
||||||
<u-avatar :src="shopLogo" shape="square"></u-avatar>
|
<u-avatar :src="shopLogo" shape="square"></u-avatar>
|
||||||
</view>
|
</view>
|
||||||
<view class="coreshop-margin-left-10 coreshop-padding-left-40 coreshop-padding-right-40">
|
<view class="coreshop-margin-left-10 coreshop-flex-sub">
|
||||||
<view class="coreshop-margin-bottom-5 coreshop-text-white">{{shopName || ' '}}</view>
|
<view class="coreshop-margin-bottom-5 coreshop-text-white">{{shopName || ' '}}</view>
|
||||||
<view class="coreshop-font-sm u-line-1 coreshop-text-white">{{shareTitle || ' '}}</view>
|
<view class="coreshop-font-sm u-line-1 coreshop-text-white">{{shareTitle || ' '}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view style="width: 150rpx;">
|
||||||
<u-button type="default" size="mini" :plain="true" @click="doPhoneCall" icon="phone" text="联系商家" color="#272d47"></u-button>
|
<u-button type="default" size="mini" :plain="true" @click="doPhoneCall" icon="phone" text="联系商家" color="#272d47"></u-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="page-box coreshop-margin-top-20" v-if="listData.length > 0">
|
<view class="page-box coreshop-margin-top-20" v-if="listData.length > 0">
|
||||||
|
|||||||
@@ -413,20 +413,20 @@
|
|||||||
<!-- 客服按钮 -->
|
<!-- 客服按钮 -->
|
||||||
<!-- #ifdef APP-PLUS-NVUE || APP-PLUS -->
|
<!-- #ifdef APP-PLUS-NVUE || APP-PLUS -->
|
||||||
<view class="action" @click="showChat()">
|
<view class="action" @click="showChat()">
|
||||||
<button class="noButtonStyle">
|
<button class="noButtonStyle" style="width: 120rpx;" >
|
||||||
<u-icon name="server-fill" :size="20" label="找客服" :labelSize="12" labelPos="bottom"></u-icon>
|
<u-icon name="server-fill" :size="20" label="找客服" :labelSize="12" labelPos="bottom"></u-icon>
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<view class="action">
|
<view class="action">
|
||||||
<button open-type="contact" bindcontact="showChat" class="noButtonStyle" :send-message-title="goodsInfo.name" :send-message-path="'/pages/goods/goodDetails/goodDetails?id='+goodsInfo.id" :send-message-img="goodsInfo.image" show-message-card="true">
|
<button style="width: 120rpx;" open-type="contact" bindcontact="showChat" class="noButtonStyle" :send-message-title="goodsInfo.name" :send-message-path="'/pages/goods/goodDetails/goodDetails?id='+goodsInfo.id" :send-message-img="goodsInfo.image" show-message-card="true">
|
||||||
<u-icon name="server-fill" :size="20" label="找客服" :labelSize="12" space="5px" labelPos="bottom"></u-icon>
|
<u-icon name="server-fill" :size="20" label="找客服" :labelSize="12" space="5px" labelPos="bottom"></u-icon>
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<view class="action" @click="redirectCart">
|
<view class="action" @click="redirectCart">
|
||||||
<button class="noButtonStyle">
|
<button class="noButtonStyle" style="width: 120rpx;" >
|
||||||
<u-badge type="warning" :value="cartNums" showZero="false" absolute="true" :offset="[1, 4]"></u-badge>
|
<u-badge type="warning" :value="cartNums" showZero="false" absolute="true" :offset="[1, 4]"></u-badge>
|
||||||
<u-icon name="shopping-cart-fill" :size="24" label="购物车" :labelSize="12" space="1px" labelPos="bottom"></u-icon>
|
<u-icon name="shopping-cart-fill" :size="24" label="购物车" :labelSize="12" space="1px" labelPos="bottom"></u-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
.user-info-box { padding-top: 20px;
|
.user-info-box { padding-top: 20px;
|
||||||
.login-user-view { position: relative; text-align: center;
|
.login-user-view { position: relative; text-align: center;
|
||||||
.login-user-avatar-view { position: relative; margin-bottom: 10px; align-items: center; justify-content: center; display: flex; }
|
.login-user-avatar-view { position: relative; margin-bottom: 10px; align-items: center; justify-content: center; display: flex; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.user-info-tip-box { position: relative; margin: 10px 14px; border-radius: 10px; padding: 10px 14px;
|
.user-info-tip-box { position: relative; margin: 10px 14px; border-radius: 10px; padding: 10px 14px;
|
||||||
@@ -11,6 +12,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.btn-login{
|
||||||
|
width: 150rpx;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
.coreshop-view-content { padding: 0 10px 10px 10px; margin-top: -32px;
|
.coreshop-view-content { padding: 0 10px 10px 10px; margin-top: -32px;
|
||||||
.coreshop-user-info-order-box { border-radius: 10px;
|
.coreshop-user-info-order-box { border-radius: 10px;
|
||||||
.coreshop-list {
|
.coreshop-list {
|
||||||
|
|||||||
@@ -22,13 +22,17 @@
|
|||||||
<open-data type="userAvatarUrl"></open-data>
|
<open-data type="userAvatarUrl"></open-data>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="btn-login" >
|
||||||
<u-button type="default" size="mini" @click="goLogin()">立即登录</u-button>
|
<u-button type="default" size="mini" @click="goLogin()">立即登录</u-button>
|
||||||
|
</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef MP-ALIPAY -->
|
<!-- #ifdef MP-ALIPAY -->
|
||||||
<view class="login-user-avatar-view">
|
<view class="login-user-avatar-view">
|
||||||
<u-avatar :src="userInfo.avatarImage" size="large"></u-avatar>
|
<u-avatar :src="userInfo.avatarImage" size="60"></u-avatar>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="btn-login" >
|
||||||
<u-button type="default" size="mini" @click="goLogin()">立即登录</u-button>
|
<u-button type="default" size="mini" @click="goLogin()">立即登录</u-button>
|
||||||
|
</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|||||||
@@ -129,8 +129,9 @@
|
|||||||
if (res.status) {
|
if (res.status) {
|
||||||
uni.requestPayment({
|
uni.requestPayment({
|
||||||
provider: 'alipay',
|
provider: 'alipay',
|
||||||
tradeNO: res.data.trade_no,
|
orderInfo: res.data.tradeNo,
|
||||||
success: function (e) {
|
success: function (e) {
|
||||||
|
console.log(e);
|
||||||
if (e.errMsg === 'requestPayment:ok') {
|
if (e.errMsg === 'requestPayment:ok') {
|
||||||
_this.$refs.uToast.show({
|
_this.$refs.uToast.show({
|
||||||
message: res.msg, type: 'success', complete: function () {
|
message: res.msg, type: 'success', complete: function () {
|
||||||
|
|||||||
@@ -215,6 +215,9 @@ view, text { box-sizing: border-box; }
|
|||||||
/*底部tab切换区域占高*/
|
/*底部tab切换区域占高*/
|
||||||
.coreshop-tabbar-height { min-height: 50px; height: calc(50px + env(safe-area-inset-bottom) / 2); margin-top: 15px; }
|
.coreshop-tabbar-height { min-height: 50px; height: calc(50px + env(safe-area-inset-bottom) / 2); margin-top: 15px; }
|
||||||
|
|
||||||
|
.coreshop-margin-auto{
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
/*宽屏按钮*/
|
/*宽屏按钮*/
|
||||||
.coreshop-btn { display: inline-block; box-sizing: border-box; border-radius: 0; font-size: 14px; transform: scale(1); transition: all .5s; }
|
.coreshop-btn { display: inline-block; box-sizing: border-box; border-radius: 0; font-size: 14px; transform: scale(1); transition: all .5s; }
|
||||||
|
|||||||
@@ -0,0 +1,270 @@
|
|||||||
|
/***********************************************************************
|
||||||
|
* Project: CoreCms
|
||||||
|
* ProjectName: 核心内容管理系统
|
||||||
|
* Web: https://www.corecms.net
|
||||||
|
* Author: 大灰灰
|
||||||
|
* Email: jianweie@163.com
|
||||||
|
* CreateTime: 2024/4/10 星期三 22:28:09
|
||||||
|
* Description: 暂无
|
||||||
|
***********************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Expressions;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using CoreCms.Net.Configuration;
|
||||||
|
using CoreCms.Net.Model.Entities;
|
||||||
|
using CoreCms.Net.Model.Entities.Expression;
|
||||||
|
using CoreCms.Net.Model.FromBody;
|
||||||
|
using CoreCms.Net.Model.ViewModels.UI;
|
||||||
|
using CoreCms.Net.Filter;
|
||||||
|
using CoreCms.Net.Loging;
|
||||||
|
using CoreCms.Net.IServices;
|
||||||
|
using CoreCms.Net.Utility.Helper;
|
||||||
|
using CoreCms.Net.Utility.Extensions;
|
||||||
|
using CoreCms.Net.Web.Admin.Infrastructure;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using NPOI.HSSF.UserModel;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace CoreCms.Net.Web.Admin.Controllers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 支付宝用户信息
|
||||||
|
///</summary>
|
||||||
|
[Description("支付宝用户信息")]
|
||||||
|
[Route("api/[controller]/[action]")]
|
||||||
|
[ApiController]
|
||||||
|
[RequiredErrorForAdmin]
|
||||||
|
[Authorize(Permissions.Name)]
|
||||||
|
public class CoreCmsAliPayUserInfoController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||||
|
private readonly ICoreCmsAliPayUserInfoServices _coreCmsAliPayUserInfoServices;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 构造函数
|
||||||
|
///</summary>
|
||||||
|
public CoreCmsAliPayUserInfoController(IWebHostEnvironment webHostEnvironment
|
||||||
|
, ICoreCmsAliPayUserInfoServices coreCmsAliPayUserInfoServices
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_webHostEnvironment = webHostEnvironment;
|
||||||
|
_coreCmsAliPayUserInfoServices = coreCmsAliPayUserInfoServices;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 获取列表============================================================
|
||||||
|
// POST: Api/CoreCmsAliPayUserInfo/GetPageList
|
||||||
|
/// <summary>
|
||||||
|
/// 获取列表
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Description("获取列表")]
|
||||||
|
public async Task<AdminUiCallBack> GetPageList()
|
||||||
|
{
|
||||||
|
var jm = new AdminUiCallBack();
|
||||||
|
var pageCurrent = Request.Form["page"].FirstOrDefault().ObjectToInt(1);
|
||||||
|
var pageSize = Request.Form["limit"].FirstOrDefault().ObjectToInt(30);
|
||||||
|
var where = PredicateBuilder.True<CoreCmsAliPayUserInfo>();
|
||||||
|
//获取排序字段
|
||||||
|
var orderField = Request.Form["orderField"].FirstOrDefault();
|
||||||
|
|
||||||
|
Expression<Func<CoreCmsAliPayUserInfo, object>> orderEx = orderField switch
|
||||||
|
{
|
||||||
|
"id" => p => p.id,
|
||||||
|
"accessToken" => p => p.accessToken,
|
||||||
|
"aliPayUserInfoId" => p => p.aliPayUserInfoId,
|
||||||
|
"authStart" => p => p.authStart,
|
||||||
|
"expiresIn" => p => p.expiresIn,
|
||||||
|
"reExpiresIn" => p => p.reExpiresIn,
|
||||||
|
"refreshToken" => p => p.refreshToken,
|
||||||
|
"userId" => p => p.userId,
|
||||||
|
"unionId" => p => p.unionId,
|
||||||
|
"createTime" => p => p.createTime,
|
||||||
|
_ => p => p.id
|
||||||
|
};
|
||||||
|
|
||||||
|
//设置排序方式
|
||||||
|
var orderDirection = Request.Form["orderDirection"].FirstOrDefault();
|
||||||
|
var orderBy = orderDirection switch
|
||||||
|
{
|
||||||
|
"asc" => OrderByType.Asc,
|
||||||
|
"desc" => OrderByType.Desc,
|
||||||
|
_ => OrderByType.Desc
|
||||||
|
};
|
||||||
|
//查询筛选
|
||||||
|
|
||||||
|
//序列 int
|
||||||
|
var id = Request.Form["id"].FirstOrDefault().ObjectToInt(0);
|
||||||
|
if (id > 0)
|
||||||
|
{
|
||||||
|
where = where.And(p => p.id == id);
|
||||||
|
}
|
||||||
|
//accessToken nvarchar
|
||||||
|
var accessToken = Request.Form["accessToken"].FirstOrDefault();
|
||||||
|
if (!string.IsNullOrEmpty(accessToken))
|
||||||
|
{
|
||||||
|
where = where.And(p => p.accessToken.Contains(accessToken));
|
||||||
|
}
|
||||||
|
//支付宝用户编号 nvarchar
|
||||||
|
var aliPayUserInfoId = Request.Form["aliPayUserInfoId"].FirstOrDefault();
|
||||||
|
if (!string.IsNullOrEmpty(aliPayUserInfoId))
|
||||||
|
{
|
||||||
|
where = where.And(p => p.aliPayUserInfoId.Contains(aliPayUserInfoId));
|
||||||
|
}
|
||||||
|
//授权开始 nvarchar
|
||||||
|
var authStart = Request.Form["authStart"].FirstOrDefault();
|
||||||
|
if (!string.IsNullOrEmpty(authStart))
|
||||||
|
{
|
||||||
|
where = where.And(p => p.authStart.Contains(authStart));
|
||||||
|
}
|
||||||
|
//截止时间 int
|
||||||
|
var expiresIn = Request.Form["expiresIn"].FirstOrDefault().ObjectToInt(0);
|
||||||
|
if (expiresIn > 0)
|
||||||
|
{
|
||||||
|
where = where.And(p => p.expiresIn == expiresIn);
|
||||||
|
}
|
||||||
|
//刷新令牌时间 int
|
||||||
|
var reExpiresIn = Request.Form["reExpiresIn"].FirstOrDefault().ObjectToInt(0);
|
||||||
|
if (reExpiresIn > 0)
|
||||||
|
{
|
||||||
|
where = where.And(p => p.reExpiresIn == reExpiresIn);
|
||||||
|
}
|
||||||
|
//刷新后token nvarchar
|
||||||
|
var refreshToken = Request.Form["refreshToken"].FirstOrDefault();
|
||||||
|
if (!string.IsNullOrEmpty(refreshToken))
|
||||||
|
{
|
||||||
|
where = where.And(p => p.refreshToken.Contains(refreshToken));
|
||||||
|
}
|
||||||
|
//授权商户的user_id nvarchar
|
||||||
|
var userId = Request.Form["userId"].FirstOrDefault();
|
||||||
|
if (!string.IsNullOrEmpty(userId))
|
||||||
|
{
|
||||||
|
where = where.And(p => p.userId.Contains(userId));
|
||||||
|
}
|
||||||
|
//unionId nvarchar
|
||||||
|
var unionId = Request.Form["unionId"].FirstOrDefault();
|
||||||
|
if (!string.IsNullOrEmpty(unionId))
|
||||||
|
{
|
||||||
|
where = where.And(p => p.unionId.Contains(unionId));
|
||||||
|
}
|
||||||
|
//创建时间 datetime
|
||||||
|
var createTime = Request.Form["createTime"].FirstOrDefault();
|
||||||
|
if (!string.IsNullOrEmpty(createTime))
|
||||||
|
{
|
||||||
|
if (createTime.Contains("到"))
|
||||||
|
{
|
||||||
|
var dts = createTime.Split("到");
|
||||||
|
var dtStart = dts[0].Trim().ObjectToDate();
|
||||||
|
where = where.And(p => p.createTime > dtStart);
|
||||||
|
var dtEnd = dts[1].Trim().ObjectToDate();
|
||||||
|
where = where.And(p => p.createTime < dtEnd);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var dt = createTime.ObjectToDate();
|
||||||
|
where = where.And(p => p.createTime > dt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//获取数据
|
||||||
|
var list = await _coreCmsAliPayUserInfoServices.QueryPageAsync(where, orderEx, orderBy, pageCurrent, pageSize, true);
|
||||||
|
//返回数据
|
||||||
|
jm.data = list;
|
||||||
|
jm.code = 0;
|
||||||
|
jm.count = list.TotalCount;
|
||||||
|
jm.msg = "数据调用成功!";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 首页数据============================================================
|
||||||
|
// POST: Api/CoreCmsAliPayUserInfo/GetIndex
|
||||||
|
/// <summary>
|
||||||
|
/// 首页数据
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Description("首页数据")]
|
||||||
|
public AdminUiCallBack GetIndex()
|
||||||
|
{
|
||||||
|
//返回数据
|
||||||
|
var jm = new AdminUiCallBack { code = 0 };
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 编辑数据============================================================
|
||||||
|
// POST: Api/CoreCmsAliPayUserInfo/GetEdit
|
||||||
|
/// <summary>
|
||||||
|
/// 编辑数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Description("编辑数据")]
|
||||||
|
public async Task<AdminUiCallBack> GetEdit([FromBody] FMIntId entity)
|
||||||
|
{
|
||||||
|
var jm = new AdminUiCallBack();
|
||||||
|
|
||||||
|
var model = await _coreCmsAliPayUserInfoServices.QueryByIdAsync(entity.id, false);
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
jm.msg = "不存在此信息";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
jm.code = 0;
|
||||||
|
jm.data = model;
|
||||||
|
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 编辑提交============================================================
|
||||||
|
// POST: Api/CoreCmsAliPayUserInfo/Edit
|
||||||
|
/// <summary>
|
||||||
|
/// 编辑提交
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Description("编辑提交")]
|
||||||
|
public async Task<AdminUiCallBack> DoEdit([FromBody] CoreCmsAliPayUserInfo entity)
|
||||||
|
{
|
||||||
|
var jm = await _coreCmsAliPayUserInfoServices.UpdateAsync(entity);
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 预览数据============================================================
|
||||||
|
// POST: Api/CoreCmsAliPayUserInfo/GetDetails/10
|
||||||
|
/// <summary>
|
||||||
|
/// 预览数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Description("预览数据")]
|
||||||
|
public async Task<AdminUiCallBack> GetDetails([FromBody] FMIntId entity)
|
||||||
|
{
|
||||||
|
var jm = new AdminUiCallBack();
|
||||||
|
|
||||||
|
var model = await _coreCmsAliPayUserInfoServices.QueryByIdAsync(entity.id, false);
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
jm.msg = "不存在此信息";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
jm.code = 0;
|
||||||
|
jm.data = model;
|
||||||
|
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -46,6 +46,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="AlipaySDKNet.Standard" Version="4.9.78" />
|
||||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
|
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
|
||||||
<PackageReference Include="Autofac.Extras.DynamicProxy" Version="7.1.0" />
|
<PackageReference Include="Autofac.Extras.DynamicProxy" Version="7.1.0" />
|
||||||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
|
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
|
||||||
|
|||||||
@@ -5335,6 +5335,49 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:CoreCms.Net.Web.Admin.Controllers.CoreCmsAliPayUserInfoController">
|
||||||
|
<summary>
|
||||||
|
支付宝用户信息
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsAliPayUserInfoController.#ctor(Microsoft.AspNetCore.Hosting.IWebHostEnvironment,CoreCms.Net.IServices.ICoreCmsAliPayUserInfoServices)">
|
||||||
|
<summary>
|
||||||
|
构造函数
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsAliPayUserInfoController.GetPageList">
|
||||||
|
<summary>
|
||||||
|
获取列表
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsAliPayUserInfoController.GetIndex">
|
||||||
|
<summary>
|
||||||
|
首页数据
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsAliPayUserInfoController.GetEdit(CoreCms.Net.Model.FromBody.FMIntId)">
|
||||||
|
<summary>
|
||||||
|
编辑数据
|
||||||
|
</summary>
|
||||||
|
<param name="entity"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsAliPayUserInfoController.DoEdit(CoreCms.Net.Model.Entities.CoreCmsAliPayUserInfo)">
|
||||||
|
<summary>
|
||||||
|
编辑提交
|
||||||
|
</summary>
|
||||||
|
<param name="entity"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsAliPayUserInfoController.GetDetails(CoreCms.Net.Model.FromBody.FMIntId)">
|
||||||
|
<summary>
|
||||||
|
预览数据
|
||||||
|
</summary>
|
||||||
|
<param name="entity"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:CoreCms.Net.Web.Admin.Controllers.CoreCmsUserBalanceController">
|
<member name="T:CoreCms.Net.Web.Admin.Controllers.CoreCmsUserBalanceController">
|
||||||
<summary>
|
<summary>
|
||||||
用户余额表
|
用户余额表
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient"
|
dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient"
|
||||||
connectionString="Server=127.0.0.1;Database=BaseMIS;User ID=sa;Password=123456"
|
connectionString="Server=127.0.0.1;Database=BaseMIS;User ID=sa;Password=123456"
|
||||||
-->
|
-->
|
||||||
<target name="log_database" xsi:type="Database" dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient" connectionString="Server=127.0.0.1;uid=CoreShopProfessional;pwd=CoreShopProfessional;Database=CoreShopProfessional;MultipleActiveResultSets=true;pooling=true;min pool size=5;max pool size=32767;connect timeout=20;Encrypt=True;TrustServerCertificate=True;">
|
<target name="log_database" xsi:type="Database" dbProvider="MySql.Data.MySqlClient.MySqlConnection,Mysql.Data" connectionString="Server=124.223.165.131;Port=3306;Database=coreshoppro;Uid=CoreShopPro;Pwd=Txbrk5s4AR452nCF;CharSet=utf8;pooling=true;SslMode=None;Allow User Variables=true;Convert Zero Datetime=True;Allow Zero Datetime=True;">
|
||||||
<commandText>
|
<commandText>
|
||||||
INSERT INTO SysNLogRecords
|
INSERT INTO SysNLogRecords
|
||||||
(LogDate,LogLevel,LogType,LogTitle,Logger,Message,MachineName,MachineIp,NetRequestMethod
|
(LogDate,LogLevel,LogType,LogTitle,Logger,Message,MachineName,MachineIp,NetRequestMethod
|
||||||
|
|||||||
@@ -62,6 +62,9 @@ builder.Services.AddWeChatPay();
|
|||||||
//注册自定义微信接口配置文件
|
//注册自定义微信接口配置文件
|
||||||
builder.Services.Configure<CoreCms.Net.WeChat.Service.Options.WeChatOptions>(builder.Configuration.GetSection(nameof(CoreCms.Net.WeChat.Service.Options.WeChatOptions)));
|
builder.Services.Configure<CoreCms.Net.WeChat.Service.Options.WeChatOptions>(builder.Configuration.GetSection(nameof(CoreCms.Net.WeChat.Service.Options.WeChatOptions)));
|
||||||
|
|
||||||
|
//注册自定义支付宝接口配置文件
|
||||||
|
builder.Services.Configure<CoreCms.Net.Model.Options.AliPayOptions>(builder.Configuration.GetSection(nameof(CoreCms.Net.Model.Options.AliPayOptions)));
|
||||||
|
|
||||||
// 注入工厂 HTTP 客户端
|
// 注入工厂 HTTP 客户端
|
||||||
builder.Services.AddHttpClient();
|
builder.Services.AddHttpClient();
|
||||||
builder.Services.AddSingleton<CoreCms.Net.WeChat.Service.HttpClients.IWeChatApiHttpClientFactory, CoreCms.Net.WeChat.Service.HttpClients.WeChatApiHttpClientFactory>();
|
builder.Services.AddSingleton<CoreCms.Net.WeChat.Service.HttpClients.IWeChatApiHttpClientFactory, CoreCms.Net.WeChat.Service.HttpClients.WeChatApiHttpClientFactory>();
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"DbType": "SqlServer", //数据库将支持两种模式【SqlServer,MySql】
|
"DbType": "MySql", //数据库将支持两种模式【SqlServer,MySql】
|
||||||
"SqlConnection": "Server=127.0.0.1;uid=CoreShopProfessional;pwd=CoreShopProfessional;Database=CoreShopProfessional;MultipleActiveResultSets=true;pooling=true;min pool size=5;max pool size=32767;connect timeout=20;Encrypt=True;TrustServerCertificate=True;"
|
//"SqlConnection": "Server=127.0.0.1;uid=CoreShopProfessional;pwd=CoreShopProfessional;Database=CoreShopProfessional;MultipleActiveResultSets=true;pooling=true;min pool size=5;max pool size=32767;connect timeout=20;Encrypt=True;TrustServerCertificate=True;"
|
||||||
//SqlServer数据库连接字符串,需要开启数据库连接复用【MultipleActiveResultSets=true】
|
//SqlServer数据库连接字符串,需要开启数据库连接复用【MultipleActiveResultSets=true】
|
||||||
|
|
||||||
// 如果采用容器化部署Service 要写成mysql的服务名,否则写地址
|
// 如果采用容器化部署Service 要写成mysql的服务名,否则写地址
|
||||||
//"SqlConnection": "Server=127.0.0.1;Port=3306;Database=CoreShopProfessional;Uid=CoreShopProfessional;Pwd=CoreShopProfessional;CharSet=utf8;pooling=true;SslMode=None;Allow User Variables=true;Convert Zero Datetime=True;Allow Zero Datetime=True;"
|
"SqlConnection": "Server=124.223.165.131;Port=3306;Database=coreshoppro;Uid=CoreShopPro;Pwd=Txbrk5s4AR452nCF;CharSet=utf8;pooling=true;SslMode=None;Allow User Variables=true;Convert Zero Datetime=True;Allow Zero Datetime=True;"
|
||||||
// Mysql数据库链接字符串,请保持后面的属性别少。经过测试,mysql版本需要5.7或以上
|
// Mysql数据库链接字符串,请保持后面的属性别少。经过测试,mysql版本需要5.7或以上
|
||||||
},
|
},
|
||||||
//定时任务管理面板的账户密码
|
//定时任务管理面板的账户密码
|
||||||
@@ -96,5 +96,27 @@
|
|||||||
"WxOpenAppSecret": "",
|
"WxOpenAppSecret": "",
|
||||||
"WxOpenToken": "",
|
"WxOpenToken": "",
|
||||||
"WxOpenEncodingAESKey": ""
|
"WxOpenEncodingAESKey": ""
|
||||||
|
},
|
||||||
|
"AliPayOptions": {
|
||||||
|
//appid
|
||||||
|
"AppId": "",
|
||||||
|
//应用私钥
|
||||||
|
"AppSecret": "",
|
||||||
|
//支付宝公钥
|
||||||
|
"AliPublicKey": "",
|
||||||
|
//应用公钥
|
||||||
|
"AppPublicKey": "",
|
||||||
|
//回调地址
|
||||||
|
"RedirectUrl": "",
|
||||||
|
//阿里访问令牌刷新
|
||||||
|
"AliAccessTokenRefresh": "",
|
||||||
|
//oauth2授权地址
|
||||||
|
"AppConnectUrl": "https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?",
|
||||||
|
//支付宝授权类型
|
||||||
|
"AppAuthToken": "alipay.open.auth.token.app",
|
||||||
|
//支付宝通用接口
|
||||||
|
"AliPublicApi": "https://openapi.alipay.com/gateway.do",
|
||||||
|
//外部H5唤起支付宝客户端进行实名认证接口地址
|
||||||
|
"AliPayAppAuth": "alipays://platformapi/startapp?appId=20000067&url="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,117 @@
|
|||||||
|
<script type="text/html" template lay-done="layui.data.done(d);">
|
||||||
|
<table class="layui-table layui-form" lay-filter="LAY-app-CoreCmsAliPayUserInfo-detailsForm" id="LAY-app-CoreCmsAliPayUserInfo-detailsForm">
|
||||||
|
<colgroup>
|
||||||
|
<col width="100">
|
||||||
|
<col>
|
||||||
|
</colgroup>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="id">序列</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ d.params.data.id || '' }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="accessToken">accessToken</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ d.params.data.accessToken || '' }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="aliPayUserInfoId">支付宝用户编号</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ d.params.data.aliPayUserInfoId || '' }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="authStart">授权开始</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ d.params.data.authStart || '' }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="expiresIn">截止时间</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ d.params.data.expiresIn || '' }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="reExpiresIn">刷新令牌时间</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ d.params.data.reExpiresIn || '' }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="refreshToken">刷新后token</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ d.params.data.refreshToken || '' }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="userId">授权商户的user_id</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ d.params.data.userId || '' }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="unionId">unionId</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ d.params.data.unionId || '' }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="createTime">创建时间</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ d.params.data.createTime || '' }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
var debug= layui.setter.debug;
|
||||||
|
layui.data.done = function (d) {
|
||||||
|
//开启调试情况下获取接口赋值数据
|
||||||
|
if (debug) { console.log(d.params.data); }
|
||||||
|
|
||||||
|
layui.use(['admin', 'form', 'coreHelper'], function () {
|
||||||
|
var $ = layui.$
|
||||||
|
, setter = layui.setter
|
||||||
|
, admin = layui.admin
|
||||||
|
, coreHelper = layui.coreHelper
|
||||||
|
, form = layui.form;
|
||||||
|
form.render(null, 'LAY-app-CoreCmsAliPayUserInfo-detailsForm');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,182 @@
|
|||||||
|
<title>支付宝用户信息</title>
|
||||||
|
<!--当前位置开始-->
|
||||||
|
<div class="layui-card layadmin-header">
|
||||||
|
<div class="layui-breadcrumb" lay-filter="breadcrumb">
|
||||||
|
<script type="text/html" template lay-done="layui.data.updateMainBreadcrumb();">
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--当前位置结束-->
|
||||||
|
<style>
|
||||||
|
/* 重写样式 */
|
||||||
|
</style>
|
||||||
|
<script type="text/html" template lay-type="Post" lay-url="Api/CoreCmsAliPayUserInfo/GetIndex" lay-done="layui.data.done(d);">
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<div class="table-body">
|
||||||
|
<table id="LAY-app-CoreCmsAliPayUserInfo-tableBox" lay-filter="LAY-app-CoreCmsAliPayUserInfo-tableBox"></table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/html" id="LAY-app-CoreCmsAliPayUserInfo-toolbar">
|
||||||
|
<div class="layui-form coreshop-toolbar-search-form">
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<div class="layui-inline">
|
||||||
|
<label class="layui-form-label" for="aliPayUserInfoId">支付宝用户编号</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="text" name="aliPayUserInfoId" placeholder="请输入支付宝用户编号" class="layui-input">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-inline">
|
||||||
|
<label class="layui-form-label" for="userId">授权商户userId</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="text" name="userId" placeholder="请输入授权商户的user_id" class="layui-input">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-inline">
|
||||||
|
<label class="layui-form-label" for="createTime">创建时间</label>
|
||||||
|
<div class="layui-input-inline" style="width: 260px;">
|
||||||
|
<input type="text" name="createTime" id="searchTime-CoreCmsAliPayUserInfo-createTime" placeholder="请输入创建时间" class="layui-input">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-inline">
|
||||||
|
<button class="layui-btn layui-btn-sm" lay-submit lay-filter="LAY-app-CoreCmsAliPayUserInfo-search"><i class="layui-icon layui-icon-search"></i>筛选</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/html" id="LAY-app-CoreCmsAliPayUserInfo-tableBox-bar">
|
||||||
|
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
|
||||||
|
<!--<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
||||||
|
<a class="layui-btn layui-btn-danger layui-btn-xs" data-dropdown="#CoreCmsAliPayUserInfoTbDelDrop{{d.LAY_INDEX}}" no-shade="true">删除</a>
|
||||||
|
<div class="dropdown-menu-nav dropdown-popconfirm dropdown-top-right layui-hide" id="CoreCmsAliPayUserInfoTbDelDrop{{d.LAY_INDEX}}"
|
||||||
|
style="max-width: 200px;white-space: normal;min-width: auto;margin-left: 10px;">
|
||||||
|
<div class="dropdown-anchor"></div>
|
||||||
|
<div class="dropdown-popconfirm-title">
|
||||||
|
<i class="layui-icon layui-icon-help"></i>
|
||||||
|
确定要删除吗?
|
||||||
|
</div>
|
||||||
|
<div class="dropdown-popconfirm-btn">
|
||||||
|
<a class="layui-btn layui-btn-primary cursor" btn-cancel>取消</a>
|
||||||
|
<a class="layui-btn layui-btn-normal cursor" lay-event="del">确定</a>
|
||||||
|
</div>
|
||||||
|
</div>-->
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var indexData;
|
||||||
|
var debug = layui.setter.debug;
|
||||||
|
layui.data.done = function (d) {
|
||||||
|
//开启调试情况下获取接口赋值数据
|
||||||
|
if (debug) { console.log(d); }
|
||||||
|
|
||||||
|
indexData = d.data;
|
||||||
|
layui.use(['index', 'table', 'laydate', 'util', 'coredropdown', 'coreHelper'],
|
||||||
|
function () {
|
||||||
|
var $ = layui.$
|
||||||
|
, admin = layui.admin
|
||||||
|
, table = layui.table
|
||||||
|
, form = layui.form
|
||||||
|
, laydate = layui.laydate
|
||||||
|
, setter = layui.setter
|
||||||
|
, coreHelper = layui.coreHelper
|
||||||
|
, util = layui.util
|
||||||
|
, view = layui.view;
|
||||||
|
|
||||||
|
var searchwhere;
|
||||||
|
//监听搜索
|
||||||
|
form.on('submit(LAY-app-CoreCmsAliPayUserInfo-search)',
|
||||||
|
function (data) {
|
||||||
|
var field = data.field;
|
||||||
|
searchwhere = field;
|
||||||
|
//执行重载
|
||||||
|
table.reloadData('LAY-app-CoreCmsAliPayUserInfo-tableBox', { where: field });
|
||||||
|
});
|
||||||
|
//数据绑定
|
||||||
|
table.render({
|
||||||
|
elem: '#LAY-app-CoreCmsAliPayUserInfo-tableBox',
|
||||||
|
url: layui.setter.apiUrl + 'Api/CoreCmsAliPayUserInfo/GetPageList',
|
||||||
|
method: 'POST',
|
||||||
|
toolbar: '#LAY-app-CoreCmsAliPayUserInfo-toolbar',
|
||||||
|
className: 'pagebarbox',
|
||||||
|
defaultToolbar: ['filter', 'print', 'exports'],
|
||||||
|
height: 'full-127',//面包屑142px,搜索框4行172,3行137,2行102,1行67
|
||||||
|
page: true,
|
||||||
|
limit: 30,
|
||||||
|
limits: [10, 15, 20, 25, 30, 50, 100, 200],
|
||||||
|
text: { none: '暂无相关数据' },
|
||||||
|
cols: [
|
||||||
|
[
|
||||||
|
{ type: "checkbox", fixed: "left" },
|
||||||
|
{ field: 'id', title: '序列', width: 60, sort: false },
|
||||||
|
{ field: 'aliPayUserInfoId', title: '支付宝用户编号', sort: false, width: 230 },
|
||||||
|
{ field: 'userId', title: '授权商户的user_id', sort: false, width: 130 },
|
||||||
|
{ field: 'authStart', title: '授权开始', sort: false, width: 140 },
|
||||||
|
{ field: 'expiresIn', title: '截止时间戳', sort: false, width: 105 },
|
||||||
|
{ field: 'reExpiresIn', title: '刷新令牌时间', sort: false, width: 105 },
|
||||||
|
{ field: 'accessToken', title: 'accessToken', sort: false },
|
||||||
|
{ field: 'refreshToken', title: '刷新后token', sort: false },
|
||||||
|
{ field: 'unionId', title: 'unionId', sort: false, width: 105 },
|
||||||
|
{ field: 'createTime', title: '创建时间', width: 130, sort: false },
|
||||||
|
{ width: 162, align: 'center', title: '操作', fixed: 'right', toolbar: '#LAY-app-CoreCmsAliPayUserInfo-tableBox-bar' }
|
||||||
|
]
|
||||||
|
]
|
||||||
|
});
|
||||||
|
//监听排序事件
|
||||||
|
table.on('sort(LAY-app-CoreCmsAliPayUserInfo-tableBox)', function (obj) {
|
||||||
|
table.reloadData('LAY-app-CoreCmsAliPayUserInfo-tableBox', {
|
||||||
|
initSort: obj, //记录初始排序,如果不设的话,将无法标记表头的排序状态。
|
||||||
|
where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式)
|
||||||
|
orderField: obj.field, //排序字段
|
||||||
|
orderDirection: obj.type //排序方式
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
//监听行双击事件
|
||||||
|
table.on('rowDouble(LAY-app-CoreCmsAliPayUserInfo-tableBox)', function (obj) {
|
||||||
|
//查看详情
|
||||||
|
doDetails(obj);
|
||||||
|
});
|
||||||
|
//监听工具条
|
||||||
|
table.on('tool(LAY-app-CoreCmsAliPayUserInfo-tableBox)',
|
||||||
|
function (obj) {
|
||||||
|
if (obj.event === 'detail') {
|
||||||
|
doDetails(obj);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//执行预览操作
|
||||||
|
function doDetails(obj) {
|
||||||
|
coreHelper.Post("Api/CoreCmsAliPayUserInfo/GetDetails", { id: obj.data.id }, function (e) {
|
||||||
|
if (e.code === 0) {
|
||||||
|
admin.popup({
|
||||||
|
shadeClose: false,
|
||||||
|
title: '查看详情',
|
||||||
|
area: ['1200px', '90%'],
|
||||||
|
id: 'LAY-popup-CoreCmsAliPayUserInfo-details',
|
||||||
|
success: function (layero, index) {
|
||||||
|
view(this.id).render('user/alipayuserinfo/details', { data: e.data }).done(function () {
|
||||||
|
form.render();
|
||||||
|
});
|
||||||
|
// 禁止弹窗出现滚动条
|
||||||
|
$(layero).children('.layui-layer-content').css('overflow', 'visible');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
layer.msg(e.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
laydate.render({
|
||||||
|
elem: '#searchTime-CoreCmsAliPayUserInfo-createTime',
|
||||||
|
type: 'datetime',
|
||||||
|
range: '到',
|
||||||
|
});
|
||||||
|
|
||||||
|
//重载form
|
||||||
|
form.render();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -0,0 +1,193 @@
|
|||||||
|
using CoreCms.Net.Auth.Policys;
|
||||||
|
using CoreCms.Net.Caching.AutoMate.RedisCache;
|
||||||
|
using CoreCms.Net.IServices;
|
||||||
|
using CoreCms.Net.Model.ViewModels.UI;
|
||||||
|
using CoreCms.Net.Utility.Extensions;
|
||||||
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Security.Claims;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System;
|
||||||
|
using System.IdentityModel.Tokens.Jwt;
|
||||||
|
using CoreCms.Net.Model.Entities;
|
||||||
|
using CoreCms.Net.Model.FromBody;
|
||||||
|
using CoreCms.Net.Configuration;
|
||||||
|
using static SKIT.FlurlHttpClient.Wechat.Api.Models.WeDataQueryBindListResponse.Types;
|
||||||
|
|
||||||
|
namespace CoreCms.Net.Web.WebApi.Controllers.AliPayOAuth
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 支付宝业务交互接口
|
||||||
|
/// </summary>
|
||||||
|
[Route("api/[controller]/[action]")]
|
||||||
|
[ApiController]
|
||||||
|
public class AliPayAuthController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IAliPayServices _aliPayService;
|
||||||
|
private readonly PermissionRequirement _permissionRequirement;
|
||||||
|
private readonly ICoreCmsAliPayUserInfoServices _aliPayUserServices;
|
||||||
|
private readonly IRedisOperationRepository _redisOperationRepository;
|
||||||
|
private readonly ICoreCmsUserServices _userServices;
|
||||||
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
|
private readonly ICoreCmsUserLogServices _userLogServices;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 构造函数
|
||||||
|
/// </summary>
|
||||||
|
public AliPayAuthController(PermissionRequirement permissionRequirement, IRedisOperationRepository redisOperationRepository, ICoreCmsAliPayUserInfoServices aliPayUserServices, IAliPayServices aliPayService, ICoreCmsUserServices userServices, IHttpContextAccessor httpContextAccessor, ICoreCmsUserLogServices userLogServices)
|
||||||
|
{
|
||||||
|
_permissionRequirement = permissionRequirement;
|
||||||
|
_redisOperationRepository = redisOperationRepository;
|
||||||
|
_aliPayUserServices = aliPayUserServices;
|
||||||
|
_aliPayService = aliPayService;
|
||||||
|
_userServices = userServices;
|
||||||
|
_httpContextAccessor = httpContextAccessor;
|
||||||
|
_userLogServices = userLogServices;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 静默通过code票据返回app_auth_token相关信息
|
||||||
|
/// 前端是getAuthCode方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<WebApiCallBack> GetAliPayAppAuthTokenByCode([FromBody] FMStringId entity)
|
||||||
|
{
|
||||||
|
var jm = new WebApiCallBack();
|
||||||
|
|
||||||
|
var lockKey = "LOCK_OnLogin:user_" + entity.id;
|
||||||
|
var lockHolder = Guid.NewGuid().ToString("N"); //锁持有者
|
||||||
|
var redisUserLock = await _redisOperationRepository.LockTakeAsync(lockKey, lockHolder, TimeSpan.FromSeconds(10));
|
||||||
|
|
||||||
|
if (redisUserLock)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(entity.id))
|
||||||
|
{
|
||||||
|
jm.msg = "请提交code";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var result = _aliPayService.GetAliPayAppAuthTokenBYCode(entity.id);
|
||||||
|
|
||||||
|
if (!result.IsError)
|
||||||
|
{
|
||||||
|
var userInfo = await _aliPayUserServices.QueryByClauseAsync(p => p.userId == result.UserId);
|
||||||
|
if (userInfo != null)
|
||||||
|
{
|
||||||
|
userInfo.reExpiresIn = result.ReExpiresIn.ObjectToInt();
|
||||||
|
userInfo.expiresIn = result.ExpiresIn.ObjectToInt();
|
||||||
|
userInfo.refreshToken = result.RefreshToken;
|
||||||
|
userInfo.accessToken = result.AccessToken;
|
||||||
|
|
||||||
|
await _aliPayUserServices.UpdateAsync(userInfo);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
userInfo = new CoreCmsAliPayUserInfo();
|
||||||
|
//事物处理过程开始
|
||||||
|
userInfo.accessToken = result.AccessToken;
|
||||||
|
userInfo.aliPayUserInfoId = result.AlipayUserId;
|
||||||
|
userInfo.authStart = result.AuthStart;
|
||||||
|
userInfo.expiresIn = result.ExpiresIn.ObjectToInt();
|
||||||
|
userInfo.reExpiresIn = result.ReExpiresIn.ObjectToInt();
|
||||||
|
userInfo.refreshToken = result.RefreshToken;
|
||||||
|
userInfo.userId = result.UserId;
|
||||||
|
userInfo.openId = result.OpenId;
|
||||||
|
userInfo.unionId = result.UnionId;
|
||||||
|
userInfo.createTime = DateTime.Now;
|
||||||
|
userInfo.userInfoId = 0;
|
||||||
|
|
||||||
|
var resultData = await _aliPayUserServices.InsertAsync(userInfo, true);
|
||||||
|
|
||||||
|
userInfo.id = resultData;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (userInfo is { userInfoId: > 0 })
|
||||||
|
{
|
||||||
|
var user = await _userServices.QueryByClauseAsync(p => p.id == userInfo.userInfoId);
|
||||||
|
if (user != null)
|
||||||
|
{
|
||||||
|
if (user.status == (int)GlobalEnumVars.UserStatus.停用)
|
||||||
|
{
|
||||||
|
jm.status = false;
|
||||||
|
jm.msg = "您的账号已经被禁用。";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (user.isDelete)
|
||||||
|
{
|
||||||
|
jm.status = false;
|
||||||
|
jm.msg = "您的账号已经被禁用。";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
var claims = new List<Claim> {
|
||||||
|
new Claim(ClaimTypes.Name, user.nickName),
|
||||||
|
new Claim(JwtRegisteredClaimNames.Jti, user.id.ToString()),
|
||||||
|
new Claim(ClaimTypes.Expiration, DateTime.Now.AddSeconds(_permissionRequirement.Expiration.TotalSeconds).ToString(CultureInfo.InvariantCulture)) };
|
||||||
|
|
||||||
|
//用户标识
|
||||||
|
var identity = new ClaimsIdentity(JwtBearerDefaults.AuthenticationScheme);
|
||||||
|
identity.AddClaims(claims);
|
||||||
|
jm.status = true;
|
||||||
|
jm.data = new
|
||||||
|
{
|
||||||
|
auth = JwtToken.BuildJwtToken(claims.ToArray(), _permissionRequirement),
|
||||||
|
user
|
||||||
|
};
|
||||||
|
jm.otherData = result.UserId;
|
||||||
|
|
||||||
|
//录入登录日志
|
||||||
|
var log = new CoreCmsUserLog
|
||||||
|
{
|
||||||
|
userId = user.id,
|
||||||
|
state = (int)GlobalEnumVars.UserLogTypes.登录,
|
||||||
|
ip = _httpContextAccessor.HttpContext?.Connection.RemoteIpAddress != null ? _httpContextAccessor.HttpContext.Connection.RemoteIpAddress.MapToIPv4().ToString() : "127.0.0.1",
|
||||||
|
createTime = DateTime.Now,
|
||||||
|
parameters = GlobalEnumVars.UserLogTypes.登录.ToString()
|
||||||
|
};
|
||||||
|
await _userLogServices.InsertAsync(log);
|
||||||
|
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
jm.status = true;
|
||||||
|
jm.data = result.UserId;
|
||||||
|
jm.otherData = result.UserId;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
jm.status = false;
|
||||||
|
jm.msg = result.SubMsg;
|
||||||
|
jm.data = result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
jm.status = false;
|
||||||
|
jm.msg = e.Message;
|
||||||
|
jm.data = e;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
await _redisOperationRepository.LockReleaseAsync(lockKey, lockHolder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
jm.msg = "当前请求太频繁_请稍后再试";
|
||||||
|
}
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,8 +15,11 @@ using System.Globalization;
|
|||||||
using System.IdentityModel.Tokens.Jwt;
|
using System.IdentityModel.Tokens.Jwt;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
|
using System.Security.Cryptography.X509Certificates;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Aop.Api;
|
||||||
|
using Aop.Api.Util;
|
||||||
using CoreCms.Net.Auth.HttpContextUser;
|
using CoreCms.Net.Auth.HttpContextUser;
|
||||||
using CoreCms.Net.Auth.Policys;
|
using CoreCms.Net.Auth.Policys;
|
||||||
using CoreCms.Net.Caching.AccressToken;
|
using CoreCms.Net.Caching.AccressToken;
|
||||||
@@ -27,6 +30,8 @@ using CoreCms.Net.Loging;
|
|||||||
using CoreCms.Net.Model.Entities;
|
using CoreCms.Net.Model.Entities;
|
||||||
using CoreCms.Net.Model.Entities.Expression;
|
using CoreCms.Net.Model.Entities.Expression;
|
||||||
using CoreCms.Net.Model.FromBody;
|
using CoreCms.Net.Model.FromBody;
|
||||||
|
using CoreCms.Net.Model.Options;
|
||||||
|
using CoreCms.Net.Model.ViewModels.AliPay;
|
||||||
using CoreCms.Net.Model.ViewModels.DTO;
|
using CoreCms.Net.Model.ViewModels.DTO;
|
||||||
using CoreCms.Net.Model.ViewModels.UI;
|
using CoreCms.Net.Model.ViewModels.UI;
|
||||||
using CoreCms.Net.Utility.Extensions;
|
using CoreCms.Net.Utility.Extensions;
|
||||||
@@ -92,6 +97,8 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
|||||||
private readonly IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
private readonly IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||||
private readonly WeChatOptions _weChatOptions;
|
private readonly WeChatOptions _weChatOptions;
|
||||||
private readonly IRedisOperationRepository _redisOperationRepository;
|
private readonly IRedisOperationRepository _redisOperationRepository;
|
||||||
|
private readonly ICoreCmsAliPayUserInfoServices _aliPayUserInfoServices;
|
||||||
|
private readonly AliPayOptions _aliPayOptions;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构造函数
|
/// 构造函数
|
||||||
@@ -122,7 +129,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
|||||||
, ICoreCmsSettingServices settingServices
|
, ICoreCmsSettingServices settingServices
|
||||||
, ICoreCmsServicesServices servicesServices
|
, ICoreCmsServicesServices servicesServices
|
||||||
, IOptions<WeChatOptions> weChatOptions
|
, IOptions<WeChatOptions> weChatOptions
|
||||||
, ICoreCmsUserServicesOrderServices userServicesOrderServices, ICoreCmsUserServicesTicketServices userServicesTicketServices, ICoreCmsStoreServices storeServices, ICoreCmsCouponServices couponServices, ICoreCmsOrderServices orderServices, IWeChatApiHttpClientFactory weChatApiHttpClientFactory, IRedisOperationRepository redisOperationRepository)
|
, ICoreCmsUserServicesOrderServices userServicesOrderServices, ICoreCmsUserServicesTicketServices userServicesTicketServices, ICoreCmsStoreServices storeServices, ICoreCmsCouponServices couponServices, ICoreCmsOrderServices orderServices, IWeChatApiHttpClientFactory weChatApiHttpClientFactory, IRedisOperationRepository redisOperationRepository, ICoreCmsAliPayUserInfoServices aliPayUserInfoServices, IOptions<AliPayOptions> aliPayOptions)
|
||||||
{
|
{
|
||||||
_user = user;
|
_user = user;
|
||||||
_userWeChatInfoServices = userWeChatInfoServices;
|
_userWeChatInfoServices = userWeChatInfoServices;
|
||||||
@@ -155,6 +162,8 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
|||||||
_orderServices = orderServices;
|
_orderServices = orderServices;
|
||||||
_weChatApiHttpClientFactory = weChatApiHttpClientFactory;
|
_weChatApiHttpClientFactory = weChatApiHttpClientFactory;
|
||||||
_redisOperationRepository = redisOperationRepository;
|
_redisOperationRepository = redisOperationRepository;
|
||||||
|
_aliPayUserInfoServices = aliPayUserInfoServices;
|
||||||
|
_aliPayOptions = aliPayOptions.Value;
|
||||||
_weChatOptions = weChatOptions.Value;
|
_weChatOptions = weChatOptions.Value;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -533,7 +542,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
|||||||
/// <param name="entity"></param>
|
/// <param name="entity"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<WebApiCallBack> SmsLogin([FromBody] FMWxAccountCreate entity)
|
public async Task<WebApiCallBack> SmsLogin([FromBody] FMComAccountCreate entity)
|
||||||
{
|
{
|
||||||
var jm = await _userServices.SmsLogin(entity, (int)GlobalEnumVars.LoginType.Sms, entity.platform);
|
var jm = await _userServices.SmsLogin(entity, (int)GlobalEnumVars.LoginType.Sms, entity.platform);
|
||||||
return jm;
|
return jm;
|
||||||
@@ -573,7 +582,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
|||||||
return jm;
|
return jm;
|
||||||
}
|
}
|
||||||
|
|
||||||
var data = new FMWxAccountCreate
|
var data = new FMComAccountCreate
|
||||||
{
|
{
|
||||||
mobile = phoneNumber.phoneNumber,
|
mobile = phoneNumber.phoneNumber,
|
||||||
invitecode = entity.invitecode,
|
invitecode = entity.invitecode,
|
||||||
@@ -587,6 +596,124 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region 支付宝小程序授权拉取手机号码
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 支付宝小程序授权拉取手机号码
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<WebApiCallBack> DecryptPhoneNumberByAli([FromBody] FMAliLoginDecryptPhoneNumber entity)
|
||||||
|
{
|
||||||
|
var jm = new WebApiCallBack();
|
||||||
|
|
||||||
|
var userInfo = await _aliPayUserInfoServices.QueryByClauseAsync(p => p.userId == entity.sessionAuthId || p.openId == entity.sessionAuthId);
|
||||||
|
if (userInfo == null)
|
||||||
|
{
|
||||||
|
jm.status = false;
|
||||||
|
jm.msg = "支付宝用户信息获取失败";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
//1. 获取验签和解密所需要的参数
|
||||||
|
var content = entity.encryptedData;
|
||||||
|
// 是否为加密报文
|
||||||
|
var isDataEncrypted = !content.StartsWith("{", StringComparison.Ordinal);
|
||||||
|
var signCheckPass = false;
|
||||||
|
//2. 验签
|
||||||
|
var signContent = content;
|
||||||
|
var decryptKey = _aliPayOptions.AESKey;
|
||||||
|
// 如果是加密的报文则需要在密文的前后添加双引号
|
||||||
|
if (isDataEncrypted)
|
||||||
|
{
|
||||||
|
signContent = "\"" + signContent + "\"";
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
signCheckPass = AlipaySignature.RSACheckContent(signContent, entity.sign, _aliPayOptions.AliPublicKey, "UTF-8", "RSA2", false);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//验签异常, 日志
|
||||||
|
jm.status = false;
|
||||||
|
jm.msg = "验签失败";
|
||||||
|
jm.code = 500;
|
||||||
|
jm.otherData = ex;
|
||||||
|
NLogUtil.WriteAll(LogLevel.Error, LogType.Web, "小程序接口", "支付宝小程序授权拉取手机号码", ex);
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
if (!signCheckPass)
|
||||||
|
{
|
||||||
|
//验签不通过(异常或者报文被篡改),终止流程(不需要做解密)
|
||||||
|
jm.status = false;
|
||||||
|
jm.msg = "验签失败";
|
||||||
|
jm.code = 500;
|
||||||
|
jm.otherData = "验签不通过(异常或者报文被篡改),终止流程(不需要做解密) ";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
//3. 解密
|
||||||
|
string plainData = null;
|
||||||
|
if (isDataEncrypted)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
plainData = AlipayEncrypt.AesDencrypt(decryptKey, content, "UTF-8");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//解密异常, 记录日志
|
||||||
|
jm.status = false;
|
||||||
|
jm.msg = "解密异常";
|
||||||
|
jm.code = 500;
|
||||||
|
jm.otherData = ex;
|
||||||
|
NLogUtil.WriteAll(LogLevel.Error, LogType.Web, "小程序接口", "支付宝小程序授权拉取手机号码", ex);
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
plainData = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(plainData))
|
||||||
|
{
|
||||||
|
var obj = JsonConvert.DeserializeObject<AlipayEncryptDTO>(plainData);
|
||||||
|
if (obj is { code: "10000", msg: "Success" } && !string.IsNullOrEmpty(obj.mobile))
|
||||||
|
{
|
||||||
|
jm.status = true;
|
||||||
|
jm.msg = "获取手机号码成功";
|
||||||
|
jm.data = obj;
|
||||||
|
|
||||||
|
var data = new FMComAccountCreate
|
||||||
|
{
|
||||||
|
mobile = obj.mobile,
|
||||||
|
invitecode = entity.invitecode,
|
||||||
|
sessionAuthId = entity.sessionAuthId
|
||||||
|
};
|
||||||
|
|
||||||
|
jm = await _userServices.SmsLogin(data, (int)GlobalEnumVars.LoginType.AliPhoneNumber);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
jm.status = false;
|
||||||
|
jm.msg = "数据解码失败";
|
||||||
|
jm.data = obj;
|
||||||
|
jm.otherData = plainData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
jm.status = false;
|
||||||
|
jm.msg = "获取手机号码错误,解密失败。";
|
||||||
|
jm.code = 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region 用户短信注册并返回jwt token(弃用)======================================================
|
#region 用户短信注册并返回jwt token(弃用)======================================================
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户短信注册并返回jwt token(弃用)
|
/// 用户短信注册并返回jwt token(弃用)
|
||||||
@@ -595,7 +722,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[Obsolete]
|
[Obsolete]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<WebApiCallBack> SmsLogin2([FromBody] FMWxAccountCreate entity)
|
public async Task<WebApiCallBack> SmsLogin2([FromBody] FMComAccountCreate entity)
|
||||||
{
|
{
|
||||||
var jm = new WebApiCallBack();
|
var jm = new WebApiCallBack();
|
||||||
if (!CommonHelper.IsMobile(entity.mobile))
|
if (!CommonHelper.IsMobile(entity.mobile))
|
||||||
|
|||||||
@@ -50,6 +50,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="AlipaySDKNet.Standard" Version="4.9.78" />
|
||||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
|
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
|
||||||
<PackageReference Include="Autofac.Extras.DynamicProxy" Version="7.1.0" />
|
<PackageReference Include="Autofac.Extras.DynamicProxy" Version="7.1.0" />
|
||||||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
|
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
|
||||||
|
|||||||
@@ -103,6 +103,24 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:CoreCms.Net.Web.WebApi.Controllers.AliPayOAuth.AliPayAuthController">
|
||||||
|
<summary>
|
||||||
|
支付宝业务交互接口
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.WebApi.Controllers.AliPayOAuth.AliPayAuthController.#ctor(CoreCms.Net.Auth.Policys.PermissionRequirement,CoreCms.Net.Caching.AutoMate.RedisCache.IRedisOperationRepository,CoreCms.Net.IServices.ICoreCmsAliPayUserInfoServices,CoreCms.Net.IServices.IAliPayServices,CoreCms.Net.IServices.ICoreCmsUserServices,Microsoft.AspNetCore.Http.IHttpContextAccessor,CoreCms.Net.IServices.ICoreCmsUserLogServices)">
|
||||||
|
<summary>
|
||||||
|
构造函数
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.WebApi.Controllers.AliPayOAuth.AliPayAuthController.GetAliPayAppAuthTokenByCode(CoreCms.Net.Model.FromBody.FMStringId)">
|
||||||
|
<summary>
|
||||||
|
静默通过code票据返回app_auth_token相关信息
|
||||||
|
前端是getAuthCode方法
|
||||||
|
</summary>
|
||||||
|
<param name="entity"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:CoreCms.Net.Web.WebApi.Controllers.ArticleController">
|
<member name="T:CoreCms.Net.Web.WebApi.Controllers.ArticleController">
|
||||||
<summary>
|
<summary>
|
||||||
文章api控制器
|
文章api控制器
|
||||||
|
|||||||
@@ -72,6 +72,9 @@ builder.Services.AddWeChatPay();
|
|||||||
//注册自定义微信接口配置文件
|
//注册自定义微信接口配置文件
|
||||||
builder.Services.Configure<CoreCms.Net.WeChat.Service.Options.WeChatOptions>(builder.Configuration.GetSection(nameof(CoreCms.Net.WeChat.Service.Options.WeChatOptions)));
|
builder.Services.Configure<CoreCms.Net.WeChat.Service.Options.WeChatOptions>(builder.Configuration.GetSection(nameof(CoreCms.Net.WeChat.Service.Options.WeChatOptions)));
|
||||||
|
|
||||||
|
//注册自定义支付宝接口配置文件
|
||||||
|
builder.Services.Configure<CoreCms.Net.Model.Options.AliPayOptions>(builder.Configuration.GetSection(nameof(CoreCms.Net.Model.Options.AliPayOptions)));
|
||||||
|
|
||||||
// 注入工厂 HTTP 客户端
|
// 注入工厂 HTTP 客户端
|
||||||
builder.Services.AddHttpClient();
|
builder.Services.AddHttpClient();
|
||||||
builder.Services.AddSingleton<CoreCms.Net.WeChat.Service.HttpClients.IWeChatApiHttpClientFactory, CoreCms.Net.WeChat.Service.HttpClients.WeChatApiHttpClientFactory>();
|
builder.Services.AddSingleton<CoreCms.Net.WeChat.Service.HttpClients.IWeChatApiHttpClientFactory, CoreCms.Net.WeChat.Service.HttpClients.WeChatApiHttpClientFactory>();
|
||||||
|
|||||||
@@ -103,5 +103,27 @@
|
|||||||
"WxOpenAppSecret": "",
|
"WxOpenAppSecret": "",
|
||||||
"WxOpenToken": "",
|
"WxOpenToken": "",
|
||||||
"WxOpenEncodingAESKey": ""
|
"WxOpenEncodingAESKey": ""
|
||||||
|
},
|
||||||
|
"AliPayOptions": {
|
||||||
|
//appid
|
||||||
|
"AppId": "",
|
||||||
|
//应用私钥
|
||||||
|
"AppSecret": "",
|
||||||
|
//支付宝公钥
|
||||||
|
"AliPublicKey": "",
|
||||||
|
//应用公钥
|
||||||
|
"AppPublicKey": "",
|
||||||
|
//回调地址
|
||||||
|
"RedirectUrl": "",
|
||||||
|
//阿里访问令牌刷新
|
||||||
|
"AliAccessTokenRefresh": "",
|
||||||
|
//oauth2授权地址
|
||||||
|
"AppConnectUrl": "https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?",
|
||||||
|
//支付宝授权类型
|
||||||
|
"AppAuthToken": "alipay.open.auth.token.app",
|
||||||
|
//支付宝通用接口
|
||||||
|
"AliPublicApi": "https://openapi.alipay.com/gateway.do",
|
||||||
|
//外部H5唤起支付宝客户端进行实名认证接口地址
|
||||||
|
"AliPayAppAuth": "alipays://platformapi/startapp?appId=20000067&url="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
10664
数据库/MySql/20231008/完整数据库带商品演示20231008/完整数据库带商品演示20231008.sql
Normal file
10664
数据库/MySql/20231008/完整数据库带商品演示20231008/完整数据库带商品演示20231008.sql
Normal file
File diff suppressed because one or more lines are too long
40
数据库/MySql/20240422/升级脚本/1、CoreCmsAliPayUserInfo支付宝用户表.sql
Normal file
40
数据库/MySql/20240422/升级脚本/1、CoreCmsAliPayUserInfo支付宝用户表.sql
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
|
Source Server : 124.223.165.131
|
||||||
|
Source Server Type : MySQL
|
||||||
|
Source Server Version : 50743 (5.7.43-log)
|
||||||
|
Source Host : 124.223.165.131:3306
|
||||||
|
Source Schema : coreshoppro
|
||||||
|
|
||||||
|
Target Server Type : MySQL
|
||||||
|
Target Server Version : 50743 (5.7.43-log)
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 22/04/2024 22:58:18
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for CoreCmsAliPayUserInfo
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `CoreCmsAliPayUserInfo`;
|
||||||
|
CREATE TABLE `CoreCmsAliPayUserInfo` (
|
||||||
|
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '序列',
|
||||||
|
`accessToken` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'accessToken',
|
||||||
|
`aliPayUserInfoId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '支付宝用户编号',
|
||||||
|
`authStart` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '授权开始',
|
||||||
|
`expiresIn` int(11) NOT NULL COMMENT '截止时间',
|
||||||
|
`reExpiresIn` int(11) NOT NULL COMMENT '刷新令牌时间',
|
||||||
|
`refreshToken` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '刷新后token',
|
||||||
|
`userId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '授权商户的user_id',
|
||||||
|
`userInfoId` int(11) NOT NULL COMMENT '注册用户序列',
|
||||||
|
`openId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'openId',
|
||||||
|
`unionId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'unionId',
|
||||||
|
`createTime` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '支付宝用户信息' ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
BIN
数据库/MySql/20240422/完整数据库带商品演示20240422.rar
Normal file
BIN
数据库/MySql/20240422/完整数据库带商品演示20240422.rar
Normal file
Binary file not shown.
@@ -1,3 +1,6 @@
|
|||||||
|
20240422
|
||||||
|
【新增】表【CoreCmsAliPayUserInfo】支付宝用户表
|
||||||
|
|
||||||
20231008
|
20231008
|
||||||
【新增】表【WeChatShippingDelivery】微信发货快递公司信息表
|
【新增】表【WeChatShippingDelivery】微信发货快递公司信息表
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -0,0 +1,71 @@
|
|||||||
|
|
||||||
|
/****** Object: Table [dbo].[CoreCmsAliPayUserInfo] Script Date: 2024/4/22 <20><><EFBFBD><EFBFBD>һ 21:47:56 ******/
|
||||||
|
SET ANSI_NULLS ON
|
||||||
|
GO
|
||||||
|
|
||||||
|
SET QUOTED_IDENTIFIER ON
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE TABLE [dbo].[CoreCmsAliPayUserInfo](
|
||||||
|
[id] [int] IDENTITY(1,1) NOT NULL,
|
||||||
|
[accessToken] [nvarchar](50) NULL,
|
||||||
|
[aliPayUserInfoId] [nvarchar](50) NOT NULL,
|
||||||
|
[authStart] [nvarchar](50) NULL,
|
||||||
|
[expiresIn] [int] NOT NULL,
|
||||||
|
[reExpiresIn] [int] NOT NULL,
|
||||||
|
[refreshToken] [nvarchar](50) NULL,
|
||||||
|
[userId] [nvarchar](50) NOT NULL,
|
||||||
|
[userInfoId] [int] NOT NULL,
|
||||||
|
[openId] [nvarchar](50) NULL,
|
||||||
|
[unionId] [nvarchar](50) NULL,
|
||||||
|
[createTime] [datetime] NOT NULL,
|
||||||
|
CONSTRAINT [PK_AliPayUserInfo] PRIMARY KEY CLUSTERED
|
||||||
|
(
|
||||||
|
[id] ASC
|
||||||
|
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||||
|
) ON [PRIMARY]
|
||||||
|
GO
|
||||||
|
|
||||||
|
ALTER TABLE [dbo].[CoreCmsAliPayUserInfo] ADD CONSTRAINT [DF_CoreCmsAliPayUserInfo_userInfo] DEFAULT ((0)) FOR [userInfoId]
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CoreCmsAliPayUserInfo', @level2type=N'COLUMN',@level2name=N'id'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'accessToken' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CoreCmsAliPayUserInfo', @level2type=N'COLUMN',@level2name=N'accessToken'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'֧<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CoreCmsAliPayUserInfo', @level2type=N'COLUMN',@level2name=N'aliPayUserInfoId'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD>ʼ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CoreCmsAliPayUserInfo', @level2type=N'COLUMN',@level2name=N'authStart'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD><EFBFBD>ֹʱ<EFBFBD><EFBFBD>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CoreCmsAliPayUserInfo', @level2type=N'COLUMN',@level2name=N'expiresIn'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ˢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CoreCmsAliPayUserInfo', @level2type=N'COLUMN',@level2name=N'reExpiresIn'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ˢ<EFBFBD>º<EFBFBD>token' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CoreCmsAliPayUserInfo', @level2type=N'COLUMN',@level2name=N'refreshToken'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD><EFBFBD>Ȩ<EFBFBD>̻<EFBFBD><EFBFBD><EFBFBD>user_id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CoreCmsAliPayUserInfo', @level2type=N'COLUMN',@level2name=N'userId'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ע<EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CoreCmsAliPayUserInfo', @level2type=N'COLUMN',@level2name=N'userInfoId'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'openId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CoreCmsAliPayUserInfo', @level2type=N'COLUMN',@level2name=N'openId'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'unionId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CoreCmsAliPayUserInfo', @level2type=N'COLUMN',@level2name=N'unionId'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CoreCmsAliPayUserInfo', @level2type=N'COLUMN',@level2name=N'createTime'
|
||||||
|
GO
|
||||||
|
|
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'֧<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>Ϣ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CoreCmsAliPayUserInfo'
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
BIN
数据库/SqlServer/20240422/完整数据库带商品演示20240422.rar
Normal file
BIN
数据库/SqlServer/20240422/完整数据库带商品演示20240422.rar
Normal file
Binary file not shown.
@@ -1,3 +1,6 @@
|
|||||||
|
20240422
|
||||||
|
【新增】表【CoreCmsAliPayUserInfo】支付宝用户表
|
||||||
|
|
||||||
20231008
|
20231008
|
||||||
【新增】表【WeChatShippingDelivery】微信发货快递公司信息表
|
【新增】表【WeChatShippingDelivery】微信发货快递公司信息表
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user