|
@@ -22,16 +22,20 @@ using DataSharing.Share.Enums;
|
|
|
using DataSharing.Share.Requests;
|
|
|
using DotNetCore.CAP;
|
|
|
using Hotline.Share.Dtos;
|
|
|
+using Hotline.Share.Dtos.Identity;
|
|
|
using Hotline.Share.Dtos.Order;
|
|
|
using MapsterMapper;
|
|
|
using MediatR;
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
+using NETCore.Encrypt;
|
|
|
using SqlSugar;
|
|
|
using System.Security.Cryptography;
|
|
|
using System.Text;
|
|
|
+using System.Text.Json;
|
|
|
using XC.RSAUtil;
|
|
|
using XF.Domain.Cache;
|
|
|
+using XF.Domain.Constants;
|
|
|
using XF.Domain.Exceptions;
|
|
|
using XF.Domain.Repository;
|
|
|
using XF.Utility.EnumExtensions;
|
|
@@ -80,6 +84,9 @@ qAsDkLg3nhCLvvyWAsDyVdNiZDL1J6ZBA3Qoi8P2xFWSApB+ryDPs3YOtiH0QZui
|
|
|
Q9PP8NTEmKqdI3WVFYqW/OlOFC6sjiscTOOn9Tc5Mrcn8ocCjAPjkhkCCVRMiJnv
|
|
|
jxrWXHbT1FB6DqkdOnBbQqS1Azqz5HxLlSyEK3F60e3SgB5iZsDZ
|
|
|
-----END RSA PRIVATE KEY-----";
|
|
|
+
|
|
|
+ private const string AesKey = "qlzeJrbj0CPkHdFBvEAxX47Y4nCbBPZW";
|
|
|
+ private const string AesIv = "JxeDP0sgnPJdH9fE";
|
|
|
private readonly IMapper _mapper;
|
|
|
private readonly IMediator _mediator;
|
|
|
private readonly ICapPublisher _capPublisher;
|
|
@@ -696,15 +703,16 @@ jxrWXHbT1FB6DqkdOnBbQqS1Azqz5HxLlSyEK3F60e3SgB5iZsDZ
|
|
|
if (string.IsNullOrEmpty(userInfo))
|
|
|
throw UserFriendlyException.SameMessage("用户信息获取失败");
|
|
|
|
|
|
- var pkcs1 = new RsaPkcs1Util(Encoding.UTF8, PublicKey, PrivateKey);
|
|
|
- var info = pkcs1.Decrypt(userInfo, RSAEncryptionPadding.Pkcs1);
|
|
|
- if (info == null)
|
|
|
- throw UserFriendlyException.SameMessage("用户信息获取失败");
|
|
|
-
|
|
|
- var user = System.Text.Json.JsonSerializer.Deserialize<UserInfo>(info);
|
|
|
+ // var pkcs1 = new RsaPkcs1Util(Encoding.UTF8, PublicKey, PrivateKey);
|
|
|
+ //var info = pkcs1.Decrypt(userInfo, RSAEncryptionPadding.Pkcs1);
|
|
|
+ var user = Decrypt(userInfo);
|
|
|
if (user == null)
|
|
|
throw UserFriendlyException.SameMessage("用户信息获取失败");
|
|
|
|
|
|
+ //var user = System.Text.Json.JsonSerializer.Deserialize<UserInfo>(info);
|
|
|
+ //if (user == null)
|
|
|
+ // throw UserFriendlyException.SameMessage("用户信息获取失败");
|
|
|
+
|
|
|
//写入操作记录
|
|
|
|
|
|
UserOperationLog operationLog = new()
|
|
@@ -1318,15 +1326,16 @@ jxrWXHbT1FB6DqkdOnBbQqS1Azqz5HxLlSyEK3F60e3SgB5iZsDZ
|
|
|
if (string.IsNullOrEmpty(userInfo))
|
|
|
throw UserFriendlyException.SameMessage("用户信息获取失败");
|
|
|
|
|
|
- var pkcs1 = new RsaPkcs1Util(Encoding.UTF8, PublicKey, PrivateKey);
|
|
|
- var info = pkcs1.Decrypt(userInfo, RSAEncryptionPadding.Pkcs1);
|
|
|
- if (info == null)
|
|
|
- throw UserFriendlyException.SameMessage("用户信息获取失败");
|
|
|
-
|
|
|
- var user = System.Text.Json.JsonSerializer.Deserialize<UserInfo>(info);
|
|
|
+ //var pkcs1 = new RsaPkcs1Util(Encoding.UTF8, PublicKey, PrivateKey);
|
|
|
+ //var info = pkcs1.Decrypt(userInfo, RSAEncryptionPadding.Pkcs1);
|
|
|
+ var user = Decrypt(userInfo);
|
|
|
if (user == null)
|
|
|
throw UserFriendlyException.SameMessage("用户信息获取失败");
|
|
|
|
|
|
+ //var user = System.Text.Json.JsonSerializer.Deserialize<UserInfo>(info);
|
|
|
+ //if (user == null)
|
|
|
+ // throw UserFriendlyException.SameMessage("用户信息获取失败");
|
|
|
+
|
|
|
bool isSuccess = true;
|
|
|
string error = "";
|
|
|
//调用工单创建接口
|
|
@@ -1619,5 +1628,17 @@ jxrWXHbT1FB6DqkdOnBbQqS1Azqz5HxLlSyEK3F60e3SgB5iZsDZ
|
|
|
var data = await _waitSendTaskRepository.GetGetOverdueDetailsBySql(strSql).ToListAsync();
|
|
|
return data;
|
|
|
}
|
|
|
+
|
|
|
+ private UserInfo? Decrypt(string signature)
|
|
|
+ {
|
|
|
+ if (string.IsNullOrEmpty(signature)) return null;
|
|
|
+ var decrypted = EncryptProvider.AESDecrypt(signature, AesKey, AesIv);
|
|
|
+ if (string.IsNullOrEmpty(decrypted)) return null;
|
|
|
+ return System.Text.Json.JsonSerializer.Deserialize<UserInfo>(decrypted,
|
|
|
+ new JsonSerializerOptions
|
|
|
+ {
|
|
|
+ PropertyNamingPolicy = JsonNamingPolicy.CamelCase
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|