|
@@ -3,7 +3,6 @@ package com.tzld.piaoquan.tencentad.utils;
|
|
|
|
|
|
import com.tzld.piaoquan.tencentad.model.bo.ImageParam;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import sun.misc.BASE64Encoder;
|
|
|
|
|
|
import javax.imageio.ImageIO;
|
|
|
import java.awt.*;
|
|
@@ -16,6 +15,7 @@ import java.net.HttpURLConnection;
|
|
|
import java.net.URL;
|
|
|
import java.nio.file.Files;
|
|
|
import java.nio.file.Paths;
|
|
|
+import java.util.Base64;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
@@ -222,8 +222,7 @@ public class ImageUtils {
|
|
|
* @return Base64编码
|
|
|
*/
|
|
|
public static String encode(byte[] image) {
|
|
|
- BASE64Encoder decoder = new BASE64Encoder();
|
|
|
- return replaceEnter(decoder.encode(image));
|
|
|
+ return replaceEnter(Base64.getEncoder().encodeToString(image));
|
|
|
}
|
|
|
|
|
|
/**
|