From fb2c9fa355cc2e09bc051677dba89f86e9c0bd00 Mon Sep 17 00:00:00 2001
From: chenjiahe <763432473@qq.com>
Date: 星期一, 25 四月 2022 17:45:21 +0800
Subject: [PATCH] 修复MYSQL查询语句不兼容问题

---
 src/main/java/com/hx/util/SimpleEncrypt.java |   17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/src/main/java/com/hx/util/SimpleEncrypt.java b/src/main/java/com/hx/util/SimpleEncrypt.java
index 69909b0..88f48a2 100644
--- a/src/main/java/com/hx/util/SimpleEncrypt.java
+++ b/src/main/java/com/hx/util/SimpleEncrypt.java
@@ -1,12 +1,6 @@
 package com.hx.util;
 
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Random;
-
-import sun.misc.BASE64Decoder;
-import sun.misc.BASE64Encoder;
+import java.util.*;
 
 /***
  * 锟�?鍗曠殑鍔犲瘑绋嬪簭锛屽拰瑙e瘑绋嬪簭
@@ -54,11 +48,7 @@
     public static String simpleEnCode(String dataString) {
         // 缁勬嫾闅忔満鍊�
         String ranString = generateCheckCode(13).toString() + dataString + generateCheckCode(9).toString();
-
-        System.out.println(ranString);
-        // 杩涜鍔犲瘑 sun.misc.BASE64Encoder.BASE64Encoder()
-        String enCode = new BASE64Encoder().encodeBuffer(ranString.getBytes());
-
+        String enCode = new String(Base64.getEncoder().encode(ranString.getBytes()));
         return enCode;
     }
 
@@ -73,7 +63,8 @@
      */
     public static String simpleDeCode(String dataString) throws Exception {
         // 杩涜瑙e瘑sun.misc.BASE64Decoder.BASE64Decoder()
-        byte[] enCode = new BASE64Decoder().decodeBuffer(dataString);
+
+        byte[] enCode = Base64.getDecoder().decode(dataString);
         // 瑙e緱闅忔満鍊�
         String ranString = new String(enCode);
 

--
Gitblit v1.8.0