mirror of
https://github.com/dataease/dataease.git
synced 2026-05-18 01:38:11 +08:00
fix: 移动端查看分享错误
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
package io.dataease.commons.utils;
|
||||
|
||||
import static io.dataease.commons.constants.StaticResourceConstants.*;
|
||||
|
||||
import cn.hutool.core.codec.Base64Encoder;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.util.Assert;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
@@ -91,7 +92,8 @@ public class StaticResourceUtils {
|
||||
}
|
||||
// Encode byte array as Base64
|
||||
if(buffer!=null){
|
||||
return new BASE64Encoder().encode(buffer);
|
||||
|
||||
return Base64Encoder.encode(buffer);
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package io.dataease.service.staticResource;
|
||||
|
||||
import cn.hutool.core.codec.Base64Decoder;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.dataease.commons.utils.FileUtils;
|
||||
@@ -10,11 +11,8 @@ import io.dataease.exception.DataEaseException;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.Base64Utils;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import sun.misc.BASE64Decoder;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
@@ -65,7 +63,7 @@ public class StaticResourceService {
|
||||
String content = entry.getValue();
|
||||
if(StringUtils.isNotEmpty(content)){
|
||||
Files.createFile(uploadPath);
|
||||
FileCopyUtils.copy(new BASE64Decoder().decodeBuffer(content),Files.newOutputStream(uploadPath));
|
||||
FileCopyUtils.copy(Base64Decoder.decode(content),Files.newOutputStream(uploadPath));
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
|
||||
Reference in New Issue
Block a user