From 0216e1394cc9a1fd1e76ce10bea742683bfb19b3 Mon Sep 17 00:00:00 2001
From: zhc077 <565291854@qq.com>
Date: Mon, 21 Oct 2024 17:31:45 +0800
Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B9=A6-=E6=84=8F=E8=A7=81&?=
=?UTF-8?q?=E4=B8=BB=E8=A6=81=E5=8F=82=E5=8A=A0=E4=BA=BA=E5=91=98=20?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=B7=BB=E5=8A=A0=2010.21?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../system/controller/CommonController.java | 16 ++++++++++++++++
.../xiangmushu/HeZuoDanWeiDemo.vue | 4 ++--
.../kejigongguan/xiangmushu/JUploadDemo.vue | 18 +++++++++---------
.../xiangmushu/XiangMuJiXiaoMuBiaoDemo.vue | 4 ++--
4 files changed, 29 insertions(+), 13 deletions(-)
diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java
index c4abb88..5d73730 100644
--- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java
+++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java
@@ -9,6 +9,10 @@ import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.util.CommonUtils;
import org.jeecg.common.util.filter.SsrfFileTypeFilter;
import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.common.util.oss.OssBootUtil;
+import org.jeecg.modules.oss.entity.OssFile;
+import org.jeecg.modules.oss.service.IOssFileService;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.util.AntPathMatcher;
@@ -45,6 +49,9 @@ public class CommonController {
@Value(value="${jeecg.uploadType}")
private String uploadType;
+ @Autowired
+ private IOssFileService ossFileService;
+
/**
* @Author 政辉
* @return
@@ -111,6 +118,15 @@ public class CommonController {
//update-end-author:taoyan date:20200814 for:文件上传改造
}
if(oConvertUtils.isNotEmpty(savePath)){
+ String fileName = file.getOriginalFilename();
+ fileName = CommonUtils.getFileName(fileName);
+
+ //保存附件地地
+ OssFile ossFile = new OssFile();
+ ossFile.setFileName(fileName);
+ ossFile.setUrl(savePath);
+ ossFileService.save(ossFile);
+
result.setMessage(savePath);
result.setSuccess(true);
}else {
diff --git a/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/HeZuoDanWeiDemo.vue b/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/HeZuoDanWeiDemo.vue
index 6a24c6a..31b705d 100644
--- a/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/HeZuoDanWeiDemo.vue
+++ b/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/HeZuoDanWeiDemo.vue
@@ -37,8 +37,8 @@