From 2e34633b3626c3dfbe678b416cfa9fe3e86b58e0 Mon Sep 17 00:00:00 2001
From: qirong <2032486488@qq.com>
Date: 星期四, 09 三月 2023 16:05:22 +0800
Subject: [PATCH] 案件区报案人员编辑以及报案材料导出修改

---
 src/main/java/com/example/jz/service/impl/MinIOServiceImpl.java |    5 ++++-
 src/main/java/com/example/jz/controller/ReportController.java   |    5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/example/jz/controller/ReportController.java b/src/main/java/com/example/jz/controller/ReportController.java
index a99b59c..0146590 100644
--- a/src/main/java/com/example/jz/controller/ReportController.java
+++ b/src/main/java/com/example/jz/controller/ReportController.java
@@ -112,7 +112,10 @@
             return R.failed("鍏宠仈妗堜欢涓嶈兘涓虹┖");
         }
         int imgIndexFirst = report.getPic().indexOf("/img");
-        int imgIndexEnd = report.getPic().indexOf("?");
+        int imgIndexEnd = report.getPic().length();
+        if(report.getPic().indexOf("?") != -1){
+            imgIndexEnd = report.getPic().indexOf("?");
+        }
         String pic = report.getPic().substring(imgIndexFirst + 5, imgIndexEnd);
         report.setPic(pic);
         reportService.updateById(report);
diff --git a/src/main/java/com/example/jz/service/impl/MinIOServiceImpl.java b/src/main/java/com/example/jz/service/impl/MinIOServiceImpl.java
index 9c4e1b4..2358e28 100644
--- a/src/main/java/com/example/jz/service/impl/MinIOServiceImpl.java
+++ b/src/main/java/com/example/jz/service/impl/MinIOServiceImpl.java
@@ -6,6 +6,7 @@
 import com.example.jz.service.MinIOService;
 import io.minio.MinioClient;
 import io.minio.PutObjectOptions;
+import jdk.internal.org.objectweb.asm.tree.FieldInsnNode;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -27,11 +28,13 @@
     @Value("${minio.bucketName}")
     String bucketName;
 
+    private static final String PATH = "http://221.237.182.28:19000/";
+
 
     @Override
     public String getPreviewFileUrl(String fileName) {
         try {
-            return url + bucketName + '/' + fileName;
+            return PATH + bucketName + '/' + fileName;
         } catch (Exception e) {
             throw new BusinessException("鑾峰彇鏂囦欢棰勮鍦板潃澶辫触");
         }

--
Gitblit v1.8.0