Forráskód Böngészése

甬台温电签图片预览功能报错-wbsHtmlUrl写死的路径不对-改为动态获取前缀地址

DengLinLang 1 hónapja
szülő
commit
32660043b4

+ 4 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/SignPfxFilePreServiceImpl.java

@@ -42,7 +42,7 @@ public class SignPfxFilePreServiceImpl implements ISignPfxFilePreService {
     private SignPfxFilePreMapper signPfxFilePreMapper;
 
     private final String excelTabFileUrl = "https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20240731/cf9534fd3ac688df5f9d7a802ba754c0.xlsx";
-    private final String wbsHtmlUrl = "/www/wwwroot/Users/hongchuangyanfa/Desktop/privateUrl/1771066158930198528.html";
+    private final String wbsHtmlUrl = "privateUrl/1771066158930198528.html";
     @Autowired
     private BeanUtil beanUtil;
 
@@ -121,8 +121,9 @@ public class SignPfxFilePreServiceImpl implements ISignPfxFilePreService {
         Sheet sheet = workbook.getSheetAt(0);
         sheet.setForceFormulaRecalculation(true);
         List<String> sign = new ArrayList<>();
-        if (StringUtils.isNotEmpty(wbsHtmlUrl)) {
-            InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(wbsHtmlUrl);
+        String wbsHtmlUrlNow = file_path+wbsHtmlUrl;
+        if (StringUtils.isNotEmpty(wbsHtmlUrlNow)) {
+            InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(wbsHtmlUrlNow);
             String htmlString = IoUtil.readToString(inputStreamByUrl);
             Document doc = Jsoup.parse(htmlString);
             Element table = doc.select("table").first();

+ 1 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/utils/FileUtils.java

@@ -3,8 +3,6 @@ package org.springblade.manager.utils;
 import com.aspose.cells.PdfSaveOptions;
 import com.aspose.cells.SaveFormat;
 import com.aspose.cells.Workbook;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
 import com.itextpdf.text.Document;
 import com.itextpdf.text.pdf.PdfCopy;
 import com.itextpdf.text.pdf.PdfReader;
@@ -536,7 +534,7 @@ public class FileUtils {
             } else if (SystemUtils.isWindows()) {
                 file_path = "C://upload//";
             }
-        }else if(sys_isonline.equals("20")){ //109测试环境
+        }else if(sys_isonline.equals("20")){ //183
             if (SystemUtils.isMacOs()) {
                 file_path = "/home/www/wwwroot/Users/hongchuangyanfa/Desktop/";
             } else if (SystemUtils.isWindows()) {