From e5e96116469dfa164d5ec189c0373037621dabe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E9=9B=84?= Date: Mon, 10 Apr 2023 09:32:26 +0000 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=A4=87=E6=A1=88=E4=BF=A1?= =?UTF-8?q?=E6=81=AF,=E7=A6=81=E6=AD=A2=E4=B8=8A=E4=BC=A0=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B,=E5=88=A0=E9=99=A4=E6=94=AF=E6=8C=81=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E5=8A=9F=E8=83=BD=20=E6=96=B0=E5=A2=9E=E5=A4=87?= =?UTF-8?q?=E6=A1=88=E4=BF=A1=E6=81=AF,=E7=A6=81=E6=AD=A2=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E7=B1=BB=E5=9E=8B,=E5=88=A0=E9=99=A4=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=AF=86=E7=A0=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 高雄 --- .../cn/keking/config/ConfigConstants.java | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/server/src/main/java/cn/keking/config/ConfigConstants.java b/server/src/main/java/cn/keking/config/ConfigConstants.java index 4ad5a797..6d40765d 100644 --- a/server/src/main/java/cn/keking/config/ConfigConstants.java +++ b/server/src/main/java/cn/keking/config/ConfigConstants.java @@ -42,6 +42,10 @@ public class ConfigConstants { private static String pdfBookmarkDisable; private static Boolean fileUploadDisable; private static String tifPreviewType; + private static String BeiAn; + private static String[] prohibit= {}; + private static String size; + private static String password; public static final String DEFAULT_CACHE_ENABLED = "true"; public static final String DEFAULT_TXT_TYPE = "txt,html,htm,asp,jsp,xml,json,properties,md,gitignore,log,java,py,c,cpp,sql,sh,bat,m,bas,prg,cmd"; @@ -62,6 +66,10 @@ public class ConfigConstants { public static final String DEFAULT_PDF_BOOKMARK_DISABLE = "true"; public static final String DEFAULT_FILE_UPLOAD_DISABLE = "false"; public static final String DEFAULT_TIF_PREVIEW_TYPE = "tif"; + public static final String DEFAULT_BeiAn_DISABLE = "无"; + public static final String DEFAULT_size_DISABLE = "500MB"; + public static final String DEFAULT_prohibit_DISABLE = "exe,dll"; + public static final String DEFAULT_password_DISABLE = "123456"; public static Boolean isCacheEnabled() { return cacheEnabled; @@ -353,4 +361,49 @@ public class ConfigConstants { public static void setTifPreviewTypeValue(String tifPreviewType) { ConfigConstants.tifPreviewType = tifPreviewType; } + + public static String getBeiAn() { + return BeiAn; + } + @Value("${BeiAn:无}") + public void setBeiAn(String BeiAn) { + setBeiAnValue(BeiAn); + } + public static void setBeiAnValue(String BeiAn) { + ConfigConstants.BeiAn = BeiAn; + } + public static String[] getprohibit() { + return prohibit; + } + @Value("${prohibit:exe,dll}") + public void setprohibit(String prohibit) { + String[] prohibittArr = prohibit.split(","); + setprohibitValue(prohibittArr); + } + + public static void setprohibitValue(String[] prohibit) { + ConfigConstants.prohibit = prohibit; + } + public static String maxsize() { + return size; + } + @Value("${spring.servlet.multipart.max-file-size:500MB}") + public void setsize(String size) { + setsizeValue(size); + } + public static void setsizeValue(String size) { + ConfigConstants.size = size; + } + + public static String getpassword() { + return password; + } + @Value("${sc.password:123456}") + public void setpassword(String password) { + setpasswordValue(password); + } + public static void setpasswordValue(String password) { + ConfigConstants.password = password; + } + }