From 840016fa49ce6a0fa37612ef84961a8021e419f4 Mon Sep 17 00:00:00 2001
From: chenjiahe <763432473@qq.com>
Date: 星期五, 07 一月 2022 19:10:38 +0800
Subject: [PATCH] AES

---
 src/main/java/com/hx/mybatis/handler/aes/GenericStringHandler.java |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/hx/mybatis/handler/aes/GenericStringHandler.java b/src/main/java/com/hx/mybatis/handler/aes/GenericStringHandler.java
index 4701535..39e3fc0 100644
--- a/src/main/java/com/hx/mybatis/handler/aes/GenericStringHandler.java
+++ b/src/main/java/com/hx/mybatis/handler/aes/GenericStringHandler.java
@@ -1,5 +1,6 @@
 package com.hx.mybatis.handler.aes;
 
+import com.hx.springbean.VariableAesKey;
 import com.hx.util.mysql.aes.MysqlHexAes;
 import org.apache.ibatis.type.BaseTypeHandler;
 import org.apache.ibatis.type.JdbcType;
@@ -33,7 +34,7 @@
         String data = rs.getString(columnName);
         if(data != null && data.length()%32==0 && MysqlHexAes.isHexStrValid(data)){
             try{
-                data = MysqlHexAes.decryptData(data,"123456",null);
+                data = MysqlHexAes.decryptData(data, VariableAesKey.getAesKey(columnName),null);
             }catch (Exception e){
                 //e.printStackTrace();
             }

--
Gitblit v1.8.0