From 78851285202a040f8ddf998c067cd462874c1cb9 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期四, 19 十月 2023 14:55:27 +0800
Subject: [PATCH] 配置修改

---
 ManagementTravel/guns-admin/src/main/webapp/static/modular/system/tUser/tUser.js |   42 ++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/ManagementTravel/guns-admin/src/main/webapp/static/modular/system/tUser/tUser.js b/ManagementTravel/guns-admin/src/main/webapp/static/modular/system/tUser/tUser.js
index 176a1f5..3d601ee 100644
--- a/ManagementTravel/guns-admin/src/main/webapp/static/modular/system/tUser/tUser.js
+++ b/ManagementTravel/guns-admin/src/main/webapp/static/modular/system/tUser/tUser.js
@@ -64,7 +64,7 @@
             formatter: function (value, row) {
                 var btn = "";
                 if(row.phone != '' && row.phone != null) {
-                    btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.phone + '" onfocus="TUser.tooltip()">' + row.phone + '</p>']
+                    btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + decryptAES(row.phone) + '" onfocus="TUser.tooltip()">' + decryptAES(row.phone) + '</p>']
                 }
                 return btn;
             }
@@ -281,6 +281,44 @@
     }
 };
 
+var key = CryptoJS.enc.Utf8.parse("xqT86jictTPpHMem");
+var iv = CryptoJS.enc.Utf8.parse("xqT86jicxqT86jic");
+
+//aes加密
+function encryptAES(context) {
+    if(null == context || '' == context){
+        return context;
+    }
+    var encrypted = '';
+    if (typeof(context) == 'string') {
+
+    }else if(typeof(context) == 'object'){
+        context = JSON.stringify(context);
+    }
+    var srcs = CryptoJS.enc.Utf8.parse(context);
+    encrypted = CryptoJS.AES.encrypt(srcs, key, {
+        iv: iv,
+        mode: CryptoJS.mode.CBC,
+        padding: CryptoJS.pad.Pkcs7
+    });
+    return encrypted.toString();
+}
+// aes解密
+function decryptAES(context) {
+    if(null == context || '' == context){
+        return context;
+    }
+    var decrypt = CryptoJS.AES.decrypt(context, key, {
+        iv: iv,
+        mode: CryptoJS.mode.CBC,
+        padding: CryptoJS.pad.Pkcs7
+    });
+    var decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
+    return decryptedStr.toString();
+}
+
+
+
 /**
  * 查询用户管理列表
  */
@@ -289,7 +327,7 @@
     queryData['insertTime'] = $("#insertTime").val();
     queryData['id'] = $("#id").val();
     queryData['nickName'] = $("#nickName").val();
-    queryData['phone'] = $("#phone").val();
+    queryData['phone'] = encryptAES($("#phone").val());
     queryData['isAuth'] = $("#isAuth").val();
     queryData['state'] = $("#state").val();
     TUser.table.refresh({query: queryData});

--
Gitblit v1.7.1