mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2026-04-12 11:07:23 +00:00
新增 页码定位 美化前端 其他功能调整等
This commit is contained in:
@@ -17,6 +17,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
|
||||
public class ConfigConstants {
|
||||
public static final String BEAN_NAME = "configConstants";
|
||||
|
||||
|
||||
static {
|
||||
// PDFBox兼容低版本JDK
|
||||
System.setProperty("sun.java2d.cmm", "sun.java2d.cmm.kcms.KcmsServiceProvider");
|
||||
@@ -90,7 +91,7 @@ public class ConfigConstants {
|
||||
public static final String DEFAULT_PICTURES_PREVIEW = "true";
|
||||
public static final String DEFAULT_GET_CORS_FILE = "true";
|
||||
public static final String DEFAULT_ADD_TASK = "true";
|
||||
public static final String DEFAULT_AES_KEY = "1234567890123456";
|
||||
public static final String DEFAULT_AES_KEY = "false";
|
||||
|
||||
// 12. UserAgent配置常量
|
||||
public static final String DEFAULT_USER_AGENT = "false";
|
||||
@@ -134,6 +135,17 @@ public class ConfigConstants {
|
||||
// 20. 重定向启用配置常量
|
||||
public static final String DEFAULT_ENABLE_REDIRECT = "true";
|
||||
|
||||
// 22. 异步定时
|
||||
public static final String DEFAULT_ENABLE_REFRECSHSCHEDULE = "5";
|
||||
|
||||
// 23. 其他配置常量
|
||||
public static final String DEFAULT_SHOW_AES_KEY = "1234567890123456";
|
||||
public static final String DEFAULT_IS_JAVASCRIPT = "false";
|
||||
public static final String DEFAULT_XLSX_ALLOW_EDIT = "false";
|
||||
public static final String DEFAULT_XLSX_SHOW_TOOLBAR = "false";
|
||||
public static final String DEFAULT_IS_SHOW_KEY= "false";
|
||||
public static final String DEFAULT_SCRIPT_JS ="false" ;
|
||||
|
||||
// ==================================================
|
||||
// 配置变量定义区(按功能分类,均为静态变量)
|
||||
// ==================================================
|
||||
@@ -254,6 +266,18 @@ public class ConfigConstants {
|
||||
// 21. 重定向启用配置
|
||||
private static Boolean enableRedirect;
|
||||
|
||||
// 22. 异步定时
|
||||
private static int refreshSchedule;
|
||||
|
||||
// 23. 其他配置变量
|
||||
private static boolean isShowaesKey;
|
||||
private static boolean isJavaScript;
|
||||
private static boolean xlsxAllowEdit;
|
||||
private static boolean xlsxShowtoolbar;
|
||||
private static boolean isShowKey;
|
||||
private static boolean scriptJs;
|
||||
|
||||
|
||||
|
||||
// ==================================================
|
||||
// 获取方法(按功能分类)
|
||||
@@ -579,6 +603,36 @@ public class ConfigConstants {
|
||||
return enableRedirect;
|
||||
}
|
||||
|
||||
// 22. 异步定时刷新时间
|
||||
public static int getTime() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 23. 其他配置获取方法
|
||||
public static boolean getisShowaesKey() {
|
||||
return isShowaesKey;
|
||||
}
|
||||
|
||||
public static boolean getisJavaScript() {
|
||||
return isJavaScript;
|
||||
}
|
||||
|
||||
public static boolean getxlsxAllowEdit() {
|
||||
return xlsxAllowEdit;
|
||||
}
|
||||
|
||||
public static boolean getxlsxShowtoolbar() {
|
||||
return xlsxShowtoolbar;
|
||||
}
|
||||
|
||||
public static boolean getisShowKey() {
|
||||
return isShowKey;
|
||||
}
|
||||
|
||||
public static boolean getscriptJs() {
|
||||
return scriptJs;
|
||||
}
|
||||
|
||||
// ==================================================
|
||||
// Setter方法(按功能分类)
|
||||
// ==================================================
|
||||
@@ -1036,7 +1090,7 @@ public class ConfigConstants {
|
||||
}
|
||||
|
||||
// 12. 权限配置Setter方法
|
||||
@Value("${kk.Key:}")
|
||||
@Value("${kk.key:false}")
|
||||
public void setKey(String key) {
|
||||
setKeyValue(key);
|
||||
}
|
||||
@@ -1072,7 +1126,7 @@ public class ConfigConstants {
|
||||
ConfigConstants.addTask = addTask;
|
||||
}
|
||||
|
||||
@Value("${ase.key:1234567890123456}")
|
||||
@Value("${aes.key:1234567890123456}")
|
||||
public void setaesKey(String aesKey) {
|
||||
setaesKeyValue(aesKey);
|
||||
}
|
||||
@@ -1305,4 +1359,69 @@ public class ConfigConstants {
|
||||
public static void setEnableRedirectValue(Boolean enableRedirect) {
|
||||
ConfigConstants.enableRedirect = enableRedirect;
|
||||
}
|
||||
|
||||
// 22 异步定时刷新时间
|
||||
@Value("${kk.refreshSchedule:5}")
|
||||
public void setRefreshSchedule(int refreshSchedule) {
|
||||
setRefreshScheduleValue(refreshSchedule);
|
||||
}
|
||||
|
||||
public static void setRefreshScheduleValue(int refreshSchedule) {
|
||||
ConfigConstants.refreshSchedule = refreshSchedule;
|
||||
}
|
||||
|
||||
// 23. 其他配置Setter方法
|
||||
@Value("${kk.isshowaeskey:false}")
|
||||
public void setIsShowaesKey(String isShowaesKey) {
|
||||
setIsShowaesKeyValue(Boolean.parseBoolean(isShowaesKey));
|
||||
}
|
||||
|
||||
public static void setIsShowaesKeyValue(boolean isShowaesKey) {
|
||||
ConfigConstants.isShowaesKey = isShowaesKey;
|
||||
}
|
||||
|
||||
@Value("${kk.isjavascript:false}")
|
||||
public void setIsJavaScript(String isJavaScript) {
|
||||
setIsJavaScriptValue(Boolean.parseBoolean(isJavaScript));
|
||||
}
|
||||
|
||||
public static void setIsJavaScriptValue(boolean isJavaScript) {
|
||||
ConfigConstants.isJavaScript = isJavaScript;
|
||||
}
|
||||
|
||||
@Value("${kk.xlsxallowedit:false}")
|
||||
public void setXlsxAllowEdit(String xlsxAllowEdit) {
|
||||
setXlsxAllowEditValue(Boolean.parseBoolean(xlsxAllowEdit));
|
||||
}
|
||||
|
||||
public static void setXlsxAllowEditValue(boolean xlsxAllowEdit) {
|
||||
ConfigConstants.xlsxAllowEdit = xlsxAllowEdit;
|
||||
}
|
||||
|
||||
@Value("${kk.xlsxshowtoolbar:false}")
|
||||
public void setXlsxShowtoolbar(String xlsxShowtoolbar) {
|
||||
setXlsxShowtoolbarValue(Boolean.parseBoolean(xlsxShowtoolbar));
|
||||
}
|
||||
|
||||
public static void setXlsxShowtoolbarValue(boolean xlsxShowtoolbar) {
|
||||
ConfigConstants.xlsxShowtoolbar = xlsxShowtoolbar;
|
||||
}
|
||||
|
||||
@Value("${kk.isshowkey:false}")
|
||||
public void setisShowKey(String isShowKey) {
|
||||
setisShowKeyValue(Boolean.parseBoolean(isShowKey));
|
||||
}
|
||||
|
||||
public static void setisShowKeyValue(boolean isShowKey) {
|
||||
ConfigConstants.isShowKey = isShowKey;
|
||||
}
|
||||
|
||||
@Value("${kk.scriptjs:false}")
|
||||
public void setscriptJs(String scriptJs) {
|
||||
setscriptJsValue(Boolean.parseBoolean(scriptJs));
|
||||
}
|
||||
|
||||
public static void setscriptJsValue(boolean scriptJs) {
|
||||
ConfigConstants.scriptJs = scriptJs;
|
||||
}
|
||||
}
|
||||
@@ -251,11 +251,11 @@ public class ConfigRefreshComponent {
|
||||
String homeSearch = properties.getProperty("home.search", ConfigConstants.DEFAULT_HOME_SEARCH);
|
||||
|
||||
// 12. 权限配置
|
||||
String key = properties.getProperty("kk.Key", ConfigConstants.DEFAULT_KEY);
|
||||
String key = properties.getProperty("kk.key=", ConfigConstants.DEFAULT_KEY);
|
||||
boolean picturesPreview = Boolean.parseBoolean(properties.getProperty("kk.Picturespreview", ConfigConstants.DEFAULT_PICTURES_PREVIEW));
|
||||
boolean getCorsFile = Boolean.parseBoolean(properties.getProperty("kk.Getcorsfile", ConfigConstants.DEFAULT_GET_CORS_FILE));
|
||||
boolean addTask = Boolean.parseBoolean(properties.getProperty("kk.addTask", ConfigConstants.DEFAULT_ADD_TASK));
|
||||
String aesKey = properties.getProperty("ase.key", ConfigConstants.DEFAULT_AES_KEY);
|
||||
String aesKey = properties.getProperty("aes.key", ConfigConstants.DEFAULT_AES_KEY);
|
||||
|
||||
// 13. UserAgent配置
|
||||
String userAgent = properties.getProperty("useragent", ConfigConstants.DEFAULT_USER_AGENT);
|
||||
@@ -299,6 +299,17 @@ public class ConfigRefreshComponent {
|
||||
// 21. 重定向启用配置
|
||||
boolean enableRedirect = Boolean.parseBoolean(properties.getProperty("kk.enable.redirect", ConfigConstants.DEFAULT_ENABLE_REDIRECT));
|
||||
|
||||
// 22. 重定向启用配置
|
||||
int refreshSchedule = Integer.parseInt(properties.getProperty("kk.refreshSchedule ", ConfigConstants.DEFAULT_ENABLE_REFRECSHSCHEDULE).trim());
|
||||
|
||||
// 23. 其他配置
|
||||
boolean isShowaesKey = Boolean.parseBoolean(properties.getProperty("kk.isshowaeskey", ConfigConstants.DEFAULT_SHOW_AES_KEY));
|
||||
boolean isJavaScript = Boolean.parseBoolean(properties.getProperty("kk.isjavascript", ConfigConstants.DEFAULT_IS_JAVASCRIPT));
|
||||
boolean xlsxAllowEdit = Boolean.parseBoolean(properties.getProperty("kk.xlsxallowedit", ConfigConstants.DEFAULT_XLSX_ALLOW_EDIT));
|
||||
boolean xlsxShowtoolbar = Boolean.parseBoolean(properties.getProperty("kk.xlsxshowtoolbar", ConfigConstants.DEFAULT_XLSX_SHOW_TOOLBAR));
|
||||
boolean isShowKey = Boolean.parseBoolean(properties.getProperty("kk.isshowkey", ConfigConstants.DEFAULT_IS_SHOW_KEY));
|
||||
boolean scriptJs = Boolean.parseBoolean(properties.getProperty("kk.scriptjs", ConfigConstants.DEFAULT_SCRIPT_JS));
|
||||
|
||||
// 设置配置值
|
||||
// 1. 缓存配置
|
||||
ConfigConstants.setCacheEnabledValueValue(cacheEnabled);
|
||||
@@ -385,16 +396,6 @@ public class ConfigRefreshComponent {
|
||||
ConfigConstants.setMediaXLFileTimeoutValue(mediaXLFileTimeout);
|
||||
ConfigConstants.setMediaXXLFileTimeoutValue(mediaXXLFileTimeout);
|
||||
ConfigConstants.setMediaXXXLFileTimeoutValue(mediaXXXLFileTimeout);
|
||||
|
||||
// 19. CAD水印配置
|
||||
ConfigConstants.setCadwatermarkValue(cadwatermark);
|
||||
|
||||
// 20. SSL忽略配置
|
||||
ConfigConstants.setIgnoreSSLValue(ignoreSSL);
|
||||
|
||||
// 21. 重定向启用配置
|
||||
ConfigConstants.setEnableRedirectValue(enableRedirect);
|
||||
|
||||
// 16. PDF DPI配置
|
||||
ConfigConstants.setPdfDpiEnabledValue(pdfDpiEnabled);
|
||||
ConfigConstants.setPdfSmallDpiValue(pdfSmallDpi);
|
||||
@@ -411,6 +412,26 @@ public class ConfigRefreshComponent {
|
||||
|
||||
// 18. PDF线程配置
|
||||
ConfigConstants.setPdfMaxThreadsValue(pdfMaxThreads);
|
||||
|
||||
// 19. CAD水印配置
|
||||
ConfigConstants.setCadwatermarkValue(cadwatermark);
|
||||
|
||||
// 20. SSL忽略配置
|
||||
ConfigConstants.setIgnoreSSLValue(ignoreSSL);
|
||||
|
||||
// 21. 重定向启用配置
|
||||
ConfigConstants.setEnableRedirectValue(enableRedirect);
|
||||
|
||||
// 22. 重定向启用配置
|
||||
ConfigConstants.setRefreshScheduleValue(refreshSchedule);
|
||||
|
||||
// 23. 其他配置
|
||||
ConfigConstants.setIsShowaesKeyValue(isShowaesKey);
|
||||
ConfigConstants.setIsJavaScriptValue(isJavaScript);
|
||||
ConfigConstants.setXlsxAllowEditValue(xlsxAllowEdit);
|
||||
ConfigConstants.setXlsxShowtoolbarValue(xlsxShowtoolbar);
|
||||
ConfigConstants.setisShowKeyValue(isShowKey);
|
||||
ConfigConstants.setscriptJsValue(scriptJs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user