Преглед изворни кода

车资料(加密解密--> CRUD、其他相关接口代码更改、测试(本地、生产环境))1

LEIYI пре 3 месеци
родитељ
комит
e6f85a3882

+ 14 - 4
OASystem/OASystem.Infrastructure/Repositories/Resource/CarDataRepository.cs

@@ -4,6 +4,7 @@ using OASystem.Domain.AesEncryption;
 using OASystem.Domain.Dtos.Resource;
 using OASystem.Domain.Entities.Resource;
 using OASystem.Domain.ViewModels.Resource;
+using XAct;
 
 namespace OASystem.Infrastructure.Repositories.Resource
 {
@@ -44,6 +45,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
 
                 if (dto.PageSize == 0 && dto.PageIndex == 0)
                 {
+                    foreach (var item in carDatas) EncryptionProcessor.DecryptProperties(item);
                     return new Result()
                     {
                         Code = 0,
@@ -62,10 +64,13 @@ namespace OASystem.Infrastructure.Repositories.Resource
                     for (int i = 0; i < dto.PageSize; i++)
                     {
                         var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
-                        if (RowIndex < carDatas.Count) ListData.Add(carDatas[RowIndex]);
+                        if (RowIndex < carDatas.Count) {
+                            EncryptionProcessor.DecryptProperties(carDatas[RowIndex]);
+                            ListData.Add(carDatas[RowIndex]);
+                        }
                         else break;
                     }
-                    foreach (var item in ListData) EncryptionProcessor.DecryptProperties(item);
+
                     return new Result()
                     {
                         Code = 0,
@@ -84,6 +89,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
 
                 if (dto.PageSize == 0 || dto.PageIndex == 0)
                 {
+                    foreach (var item in carDatas) EncryptionProcessor.DecryptProperties(item);
                     return new Result()
                     {
                         Code = 0,
@@ -102,10 +108,14 @@ namespace OASystem.Infrastructure.Repositories.Resource
                     for (int i = 0; i < dto.PageSize; i++)
                     {
                         var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
-                        if (RowIndex < carDatas.Count) ListData.Add(carDatas[RowIndex]);
+                        if (RowIndex < carDatas.Count)
+                        {
+                            EncryptionProcessor.DecryptProperties(carDatas[RowIndex]);
+                            ListData.Add(carDatas[RowIndex]);
+                        }
                         else break;
                     }
-                    foreach (var item in ListData) EncryptionProcessor.DecryptProperties(item);
+
                     return new Result()
                     {
                         Code = 0,