nanMing 2 年 前
コミット
e9f5fa6359

+ 6 - 5
ruoyi-ui/src/api/tool/sm4.js

@@ -418,7 +418,9 @@ function SM4Util() {
         var bytesLength = v[0].length;
         var store = _arr[i].toString(2).slice(7 - bytesLength);
         for (var st = 1; st < bytesLength; st++) {
-          store += _arr[st + i].toString(2).slice(2);
+          if (_arr[st + i]) {
+            store += _arr[st + i].toString(2).slice(2);
+          }
         }
         str += String.fromCharCode(parseInt(store, 2));
         i += bytesLength - 1;
@@ -498,7 +500,7 @@ function mask(str, type) {
     {
       return maskA(str, 1);
     }
-   else  //其他
+    else  //其他
     {
       return str;
     }
@@ -508,7 +510,7 @@ function mask(str, type) {
   }
 }
 
-function maskArr(arr,type){
+function maskArr(arr, type) {
   let res = []
   arr.forEach((str) => {
     let strcd = str != null ? str.length : 0;
@@ -557,8 +559,7 @@ function maskArr(arr,type){
       {
         res.push(maskA(str, 1))
       }
-      else
-      {
+      else {
         res.push(str)
       }
     }

+ 4 - 3
ruoyi-ui/src/views/organization/kugl/nlpg/index.vue

@@ -228,6 +228,7 @@ import {addNlpg, delNlpg, getNlpg, listNlpg, updateNlpg} from "@/api/organizatio
 import khSelect from '@/components/khSelect/index'
 import {mapState} from "vuex";
 import {chineseOne} from '@/utils/regular'
+import { decryptData_ECB, decryptRowData_ECB } from "@/api/tool/sm4";
 
 export default {
     components: {
@@ -348,7 +349,7 @@ export default {
       getList() {
         this.loading = true;
         listNlpg(this.queryParams).then(response => {
-          this.nlpgList = response.rows;
+          this.nlpgList = decryptRowData_ECB(response.rows, ["xm", "zjhm"], [1, 2]);
           this.total = response.total;
           this.loading = false;
         });
@@ -410,7 +411,7 @@ export default {
         this.reset();
         const id = row.id || this.ids
         getNlpg(id).then(response => {
-          this.form = response.data;
+          this.form = decryptData_ECB(response.data, ["xm", "zjhm"], [1, 2]);
           this.copyForm=this.deepCopy(response.data);
           this.open = true;
           this.title = "修改老人能力信息";
@@ -419,7 +420,7 @@ export default {
       },
       handleDetails(row) {
         getNlpg(row.id).then(response => {
-          this.detailsData = response.data;
+          this.detailsData = decryptData_ECB(response.data, ["xm", "zjhm"], [1, 2]);
           this.detailsOpen = true;
         });
       },