|
|
@@ -8,6 +8,7 @@ using Microsoft.Extensions.Logging;
|
|
|
using Microsoft.Extensions.Options;
|
|
|
using MySystem.MainModels;
|
|
|
using Library;
|
|
|
+using System.Text;
|
|
|
|
|
|
namespace MySystem.Areas.Api.Controllers
|
|
|
{
|
|
|
@@ -58,6 +59,27 @@ namespace MySystem.Areas.Api.Controllers
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+ #region 接口通用AES解密
|
|
|
+ public string AesDecrypt(string str, string key = "CBTU1dD4Kd5pyiGWTsI10jRQ3SvKusSV", string iv = "DYgjCEIMVrj2W9xN")
|
|
|
+ {
|
|
|
+ if (string.IsNullOrEmpty(str)) return null;
|
|
|
+ str = Encoding.UTF8.GetString(Convert.FromBase64String(str));
|
|
|
+ Byte[] toEncryptArray = Convert.FromBase64String(str);
|
|
|
+
|
|
|
+ System.Security.Cryptography.RijndaelManaged rm = new System.Security.Cryptography.RijndaelManaged
|
|
|
+ {
|
|
|
+ Key = Encoding.UTF8.GetBytes(key),
|
|
|
+ IV = Encoding.UTF8.GetBytes(iv),
|
|
|
+ Mode = System.Security.Cryptography.CipherMode.CBC,
|
|
|
+ Padding = System.Security.Cryptography.PaddingMode.PKCS7
|
|
|
+ };
|
|
|
+
|
|
|
+ System.Security.Cryptography.ICryptoTransform cTransform = rm.CreateDecryptor();
|
|
|
+ Byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
|
|
|
+ return Encoding.UTF8.GetString(resultArray);
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
#region 根据数字获取订单状态名称
|
|
|
|
|
|
public string getOrderStatus(int status)
|