From b8283ee76c7d02347118c21fcdddabc598143e03 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期三, 12 十月 2022 17:24:09 +0800
Subject: [PATCH] 1

---
 src/main/java/com/lf/server/service/all/FileService.java |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/lf/server/service/all/FileService.java b/src/main/java/com/lf/server/service/all/FileService.java
index e653552..a5d28e2 100644
--- a/src/main/java/com/lf/server/service/all/FileService.java
+++ b/src/main/java/com/lf/server/service/all/FileService.java
@@ -4,6 +4,7 @@
 import com.lf.server.controller.all.BaseController;
 import com.lf.server.entity.all.HttpStatus;
 import com.lf.server.entity.all.ResponseMsg;
+import com.lf.server.entity.all.SettingData;
 import com.lf.server.entity.sys.AttachEntity;
 import com.lf.server.entity.sys.UserEntity;
 import com.lf.server.helper.FileHelper;
@@ -45,8 +46,6 @@
     @Autowired
     AttachService attachService;
 
-    private static long MAX_FILE_SIZE = 20 * 1024 * 1024;
-
     private final static Log log = LogFactory.getLog(FileService.class);
 
     private static final String NO_FILE = JSON.toJSONString(new ResponseMsg<String>(HttpStatus.NOT_FOUND, "鏂囦欢鎵句笉鍒�"));
@@ -59,8 +58,8 @@
             if (file == null && file.isEmpty()) {
                 return ctrl.fail("鏂囦欢涓婁紶涓虹┖", null);
             }
-            if (file.getSize() > MAX_FILE_SIZE) {
-                return ctrl.fail(String.format("鏂囦欢澶т簬 %d MB", MAX_FILE_SIZE / 1024 / 1024), null);
+            if (file.getSize() > SettingData.MAX_FILE_SIZE) {
+                return ctrl.fail(String.format("鏂囦欢澶т簬 %d MB", SettingData.MAX_FILE_SIZE / 1024 / 1024), null);
             }
 
             // 浼犺緭鏂囦欢

--
Gitblit v1.9.3