mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 14:53:26 +08:00
【修复】修复可能存在一个用户多个微信号绑定一个手机号码,导致openid不同而支付提示【下单账号与支付账号不一致,请核实后再支付】的问题。
This commit is contained in:
@@ -29,6 +29,7 @@ namespace CoreCms.Net.Auth.HttpContextUser
|
||||
|
||||
public string Name => _accessor.HttpContext.User.Identity.Name;
|
||||
public int ID => GetClaimValueByType("jti").FirstOrDefault().ObjectToInt();
|
||||
public string OpenId => GetClaimValueByType("nameid").FirstOrDefault();
|
||||
|
||||
public bool IsAuthenticated()
|
||||
{
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace CoreCms.Net.Auth.HttpContextUser
|
||||
{
|
||||
string Name { get; }
|
||||
int ID { get; }
|
||||
string OpenId { get; }
|
||||
bool IsAuthenticated();
|
||||
IEnumerable<Claim> GetClaimsIdentity();
|
||||
List<string> GetClaimValueByType(string ClaimType);
|
||||
|
||||
@@ -121,8 +121,15 @@ namespace CoreCms.Net.Services
|
||||
return jm;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(_user.OpenId) && _user.OpenId != user.openid)
|
||||
{
|
||||
openId = _user.OpenId;
|
||||
}
|
||||
else
|
||||
{
|
||||
openId = user.openid;
|
||||
}
|
||||
|
||||
openId = user.openid;
|
||||
}
|
||||
|
||||
var notifyUrl = config.notifyUrl.EndsWith("/") ? config.notifyUrl + "m-" + config.appId : config.notifyUrl + "/m-" + config.appId;
|
||||
|
||||
@@ -248,6 +248,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
var claims = new List<Claim> {
|
||||
new Claim(ClaimTypes.Name, user.nickName),
|
||||
new Claim(JwtRegisteredClaimNames.Jti, user.id.ToString()),
|
||||
new Claim(JwtRegisteredClaimNames.NameId, response.OpenId),
|
||||
new Claim(ClaimTypes.Expiration, DateTime.Now.AddSeconds(_permissionRequirement.Expiration.TotalSeconds).ToString(CultureInfo.InvariantCulture)) };
|
||||
|
||||
//用户标识
|
||||
|
||||
Reference in New Issue
Block a user