mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-03-24 20:37:20 +08:00
【优化】优化微信小程序及微信公众号同时登录同一账号下,同时支付异常的问题。
【优化】优化后台微信用户列表展示,增加区分微信小程序和微信公众号来源的划分。
This commit is contained in:
@@ -29,6 +29,7 @@ using Newtonsoft.Json.Linq;
|
|||||||
using QRCoder;
|
using QRCoder;
|
||||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||||
using SKIT.FlurlHttpClient.Wechat.Api.Models;
|
using SKIT.FlurlHttpClient.Wechat.Api.Models;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
namespace CoreCms.Net.Services
|
namespace CoreCms.Net.Services
|
||||||
{
|
{
|
||||||
@@ -80,7 +81,7 @@ namespace CoreCms.Net.Services
|
|||||||
|
|
||||||
var payment = await billPaymentsServices.QueryByClauseAsync(p => p.paymentId == entity.paymentId);
|
var payment = await billPaymentsServices.QueryByClauseAsync(p => p.paymentId == entity.paymentId);
|
||||||
var checkBeforeAddOrder = await checkBeforeAddOrderServices.QueryByClauseAsync(p => p.orderId == payment.sourceId);
|
var checkBeforeAddOrder = await checkBeforeAddOrderServices.QueryByClauseAsync(p => p.orderId == payment.sourceId);
|
||||||
if (checkBeforeAddOrder != null && checkBeforeAddOrder.requireOrder == (int)GlobalEnumVars.RequireOrderType.需要)
|
if (checkBeforeAddOrder is { requireOrder: (int)GlobalEnumVars.RequireOrderType.需要 })
|
||||||
{
|
{
|
||||||
var order = await transactionComponentOrderServices.QueryByClauseAsync(p => p.outOrderId == payment.sourceId);
|
var order = await transactionComponentOrderServices.QueryByClauseAsync(p => p.outOrderId == payment.sourceId);
|
||||||
|
|
||||||
@@ -158,26 +159,38 @@ namespace CoreCms.Net.Services
|
|||||||
var openId = string.Empty;
|
var openId = string.Empty;
|
||||||
if (tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI.ToString() || tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI_OFFICIAL.ToString())
|
if (tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI.ToString() || tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI_OFFICIAL.ToString())
|
||||||
{
|
{
|
||||||
var userAccount = await _userServices.QueryByIdAsync(_user.ID);
|
//var userAccount = await _userServices.QueryByIdAsync(_user.ID);
|
||||||
if (userAccount == null)
|
//if (userAccount == null)
|
||||||
{
|
//{
|
||||||
jm.msg = "用户账户获取失败";
|
// jm.msg = "用户账户获取失败";
|
||||||
return jm;
|
// return jm;
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (userAccount.userWx <= 0)
|
//if (userAccount.userWx <= 0)
|
||||||
{
|
//{
|
||||||
jm.msg = "账户关联微信用户信息获取失败";
|
// jm.msg = "账户关联微信用户信息获取失败";
|
||||||
return jm;
|
// return jm;
|
||||||
}
|
//}
|
||||||
|
|
||||||
var user = await _userWeChatInfoServices.QueryByClauseAsync(p => p.id == userAccount.userWx);
|
//var user = await _userWeChatInfoServices.QueryByClauseAsync(p => p.id == userAccount.userWx);
|
||||||
|
//if (user == null)
|
||||||
|
//{
|
||||||
|
// jm.msg = "微信用户信息获取失败";
|
||||||
|
// return jm;
|
||||||
|
//}
|
||||||
|
|
||||||
|
var type = tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI.ToString()
|
||||||
|
? (int)GlobalEnumVars.UserAccountTypes.微信小程序
|
||||||
|
: (int)GlobalEnumVars.UserAccountTypes.微信公众号;
|
||||||
|
|
||||||
|
var user = await _userWeChatInfoServices.QueryByClauseAsync(p => p.userId == _user.ID && p.type == type, p => p.createTime, OrderByType.Desc);
|
||||||
if (user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
jm.msg = "微信用户信息获取失败";
|
jm.msg = "微信用户信息获取失败";
|
||||||
return jm;
|
return jm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
openId = user.openid;
|
openId = user.openid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -30,6 +30,7 @@ using Microsoft.AspNetCore.Hosting;
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using NPOI.HSSF.UserModel;
|
using NPOI.HSSF.UserModel;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
using static CoreCms.Net.Configuration.GlobalEnumVars;
|
||||||
|
|
||||||
namespace CoreCms.Net.Web.Admin.Controllers
|
namespace CoreCms.Net.Web.Admin.Controllers
|
||||||
{
|
{
|
||||||
@@ -255,6 +256,13 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
//返回数据
|
//返回数据
|
||||||
var jm = new AdminUiCallBack { code = 0 };
|
var jm = new AdminUiCallBack { code = 0 };
|
||||||
|
|
||||||
|
var userAccountTypes = EnumHelper.EnumToList<GlobalEnumVars.UserAccountTypes>();
|
||||||
|
jm.data = new
|
||||||
|
{
|
||||||
|
userAccountTypes
|
||||||
|
};
|
||||||
|
|
||||||
return jm;
|
return jm;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -117,7 +117,19 @@
|
|||||||
[
|
[
|
||||||
{ type: "checkbox", fixed: "left" },
|
{ type: "checkbox", fixed: "left" },
|
||||||
{ field: 'id', title: '微信序列', width: 70, sort: false },
|
{ field: 'id', title: '微信序列', width: 70, sort: false },
|
||||||
//{ field: 'type', title: '第三方登录类型', sort: false,width: 105 },
|
//{ field: 'type', title: '第三方登录类型', sort: false, width: 105 },
|
||||||
|
{
|
||||||
|
field: 'type', title: '登录类型', align: "center",
|
||||||
|
templet: function (data) {
|
||||||
|
var str = '';
|
||||||
|
for (i = 0; i < d.data.userAccountTypes.length; i++) {
|
||||||
|
if (data.type === d.data.userAccountTypes[i].value) { str = d.data.userAccountTypes[i].title }
|
||||||
|
}
|
||||||
|
//return str;
|
||||||
|
return "<img src='/static/images/common/userwx_" + data.type + ".jpg' style='width:28px;' title='" + str + "' />";
|
||||||
|
|
||||||
|
}, width: 90
|
||||||
|
},
|
||||||
{ field: 'userId', title: '用户序列', sort: false, width: 80 },
|
{ field: 'userId', title: '用户序列', sort: false, width: 80 },
|
||||||
{ field: 'openid', title: 'openId', sort: false },
|
{ field: 'openid', title: 'openId', sort: false },
|
||||||
//{ field: 'sessionKey', title: '缓存key', sort: false,width: 105 },
|
//{ field: 'sessionKey', title: '缓存key', sort: false,width: 105 },
|
||||||
|
|||||||
Reference in New Issue
Block a user