新增配置项office.preview.switch.disabled,控制offic文件预览切换开关

This commit is contained in:
kl
2020-12-25 18:19:30 +08:00
committed by kl
parent 4a3886e41a
commit d787813bc6
9 changed files with 27 additions and 4 deletions

View File

@@ -20,6 +20,7 @@ public class ConfigConstants {
private static String[] SIM_TEXT = {};
private static String[] MEDIA = {};
private static String OFFICE_PREVIEW_TYPE;
private static String OFFICE_PREVIEW_SWITCH_DISABLED;
private static String FTP_USERNAME;
private static String FTP_PASSWORD;
private static String FTP_CONTROL_ENCODING;
@@ -32,6 +33,7 @@ public class ConfigConstants {
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";
public static final String DEFAULT_MEDIA_TYPE = "mp3,wav,mp4,flv";
public static final String DEFAULT_OFFICE_PREVIEW_TYPE = "image";
public static final String DEFAULT_OFFICE_PREVIEW_SWITCH_DISABLED = "false";
public static final String DEFAULT_FTP_USERNAME = null;
public static final String DEFAULT_FTP_PASSWORD = null;
public static final String DEFAULT_FTP_CONTROL_ENCODING = "UTF-8";
@@ -202,4 +204,12 @@ public class ConfigConstants {
PDF_DOWNLOAD_DISABLE = pdfDownloadDisable;
}
public static String getOfficePreviewSwitchDisabled() {
return OFFICE_PREVIEW_SWITCH_DISABLED;
}
@Value("${office.preview.switch.disabled:true}")
public static void setOfficePreviewSwitchDisabled(String officePreviewSwitchDisabled) {
OFFICE_PREVIEW_SWITCH_DISABLED = officePreviewSwitchDisabled;
}
}

View File

@@ -38,6 +38,7 @@ public class ConfigRefreshComponent {
String[] textArray;
String[] mediaArray;
String officePreviewType;
String officePreviewSwitchDisabled;
String ftpUsername;
String ftpPassword;
String ftpControlEncoding;
@@ -54,6 +55,7 @@ public class ConfigRefreshComponent {
text = properties.getProperty("simText", ConfigConstants.DEFAULT_TXT_TYPE);
media = properties.getProperty("media", ConfigConstants.DEFAULT_MEDIA_TYPE);
officePreviewType = properties.getProperty("office.preview.type", ConfigConstants.DEFAULT_OFFICE_PREVIEW_TYPE);
officePreviewSwitchDisabled = properties.getProperty("office.preview.switch.disabled", ConfigConstants.DEFAULT_OFFICE_PREVIEW_TYPE);
ftpUsername = properties.getProperty("ftp.username", ConfigConstants.DEFAULT_FTP_USERNAME);
ftpPassword = properties.getProperty("ftp.password", ConfigConstants.DEFAULT_FTP_PASSWORD);
ftpControlEncoding = properties.getProperty("ftp.control.encoding", ConfigConstants.DEFAULT_FTP_CONTROL_ENCODING);
@@ -71,6 +73,7 @@ public class ConfigRefreshComponent {
ConfigConstants.setFtpControlEncodingValue(ftpControlEncoding);
ConfigConstants.setBaseUrlValue(baseUrl);
ConfigConstants.setTrustHostValue(trustHost);
ConfigConstants.setOfficePreviewSwitchDisabled(officePreviewSwitchDisabled);
ConfigConstants.setPdfDownloadDisableValue(pdfDownloadDisable);
setWatermarkConfig(properties);
bufferedReader.close();