1717public class ConfigConstants {
1818 public static final String BEAN_NAME = "configConstants" ;
1919
20+
2021 static {
2122 // PDFBox兼容低版本JDK
2223 System .setProperty ("sun.java2d.cmm" , "sun.java2d.cmm.kcms.KcmsServiceProvider" );
@@ -90,7 +91,7 @@ public class ConfigConstants {
9091 public static final String DEFAULT_PICTURES_PREVIEW = "true" ;
9192 public static final String DEFAULT_GET_CORS_FILE = "true" ;
9293 public static final String DEFAULT_ADD_TASK = "true" ;
93- public static final String DEFAULT_AES_KEY = "1234567890123456 " ;
94+ public static final String DEFAULT_AES_KEY = "false " ;
9495
9596 // 12. UserAgent配置常量
9697 public static final String DEFAULT_USER_AGENT = "false" ;
@@ -134,6 +135,17 @@ public class ConfigConstants {
134135 // 20. 重定向启用配置常量
135136 public static final String DEFAULT_ENABLE_REDIRECT = "true" ;
136137
138+ // 22. 异步定时
139+ public static final String DEFAULT_ENABLE_REFRECSHSCHEDULE = "5" ;
140+
141+ // 23. 其他配置常量
142+ public static final String DEFAULT_SHOW_AES_KEY = "1234567890123456" ;
143+ public static final String DEFAULT_IS_JAVASCRIPT = "false" ;
144+ public static final String DEFAULT_XLSX_ALLOW_EDIT = "false" ;
145+ public static final String DEFAULT_XLSX_SHOW_TOOLBAR = "false" ;
146+ public static final String DEFAULT_IS_SHOW_KEY = "false" ;
147+ public static final String DEFAULT_SCRIPT_JS ="false" ;
148+
137149 // ==================================================
138150// 配置变量定义区(按功能分类,均为静态变量)
139151// ==================================================
@@ -254,6 +266,18 @@ public class ConfigConstants {
254266 // 21. 重定向启用配置
255267 private static Boolean enableRedirect ;
256268
269+ // 22. 异步定时
270+ private static int refreshSchedule ;
271+
272+ // 23. 其他配置变量
273+ private static boolean isShowaesKey ;
274+ private static boolean isJavaScript ;
275+ private static boolean xlsxAllowEdit ;
276+ private static boolean xlsxShowtoolbar ;
277+ private static boolean isShowKey ;
278+ private static boolean scriptJs ;
279+
280+
257281
258282 // ==================================================
259283// 获取方法(按功能分类)
@@ -579,6 +603,36 @@ public static boolean isEnableRedirect() {
579603 return enableRedirect ;
580604 }
581605
606+ // 22. 异步定时刷新时间
607+ public static int getTime () {
608+ return 0 ;
609+ }
610+
611+ // 23. 其他配置获取方法
612+ public static boolean getisShowaesKey () {
613+ return isShowaesKey ;
614+ }
615+
616+ public static boolean getisJavaScript () {
617+ return isJavaScript ;
618+ }
619+
620+ public static boolean getxlsxAllowEdit () {
621+ return xlsxAllowEdit ;
622+ }
623+
624+ public static boolean getxlsxShowtoolbar () {
625+ return xlsxShowtoolbar ;
626+ }
627+
628+ public static boolean getisShowKey () {
629+ return isShowKey ;
630+ }
631+
632+ public static boolean getscriptJs () {
633+ return scriptJs ;
634+ }
635+
582636// ==================================================
583637// Setter方法(按功能分类)
584638// ==================================================
@@ -1036,7 +1090,7 @@ public static void setHomeSearchValue(String homeSearch) {
10361090 }
10371091
10381092 // 12. 权限配置Setter方法
1039- @ Value ("${kk.Key: }" )
1093+ @ Value ("${kk.key:false }" )
10401094 public void setKey (String key ) {
10411095 setKeyValue (key );
10421096 }
@@ -1072,7 +1126,7 @@ public static void setAddTaskValue(boolean addTask) {
10721126 ConfigConstants .addTask = addTask ;
10731127 }
10741128
1075- @ Value ("${ase .key:1234567890123456}" )
1129+ @ Value ("${aes .key:1234567890123456}" )
10761130 public void setaesKey (String aesKey ) {
10771131 setaesKeyValue (aesKey );
10781132 }
@@ -1305,4 +1359,69 @@ public void setEnableRedirect(String enableRedirect) {
13051359 public static void setEnableRedirectValue (Boolean enableRedirect ) {
13061360 ConfigConstants .enableRedirect = enableRedirect ;
13071361 }
1362+
1363+ // 22 异步定时刷新时间
1364+ @ Value ("${kk.refreshSchedule:5}" )
1365+ public void setRefreshSchedule (int refreshSchedule ) {
1366+ setRefreshScheduleValue (refreshSchedule );
1367+ }
1368+
1369+ public static void setRefreshScheduleValue (int refreshSchedule ) {
1370+ ConfigConstants .refreshSchedule = refreshSchedule ;
1371+ }
1372+
1373+ // 23. 其他配置Setter方法
1374+ @ Value ("${kk.isshowaeskey:false}" )
1375+ public void setIsShowaesKey (String isShowaesKey ) {
1376+ setIsShowaesKeyValue (Boolean .parseBoolean (isShowaesKey ));
1377+ }
1378+
1379+ public static void setIsShowaesKeyValue (boolean isShowaesKey ) {
1380+ ConfigConstants .isShowaesKey = isShowaesKey ;
1381+ }
1382+
1383+ @ Value ("${kk.isjavascript:false}" )
1384+ public void setIsJavaScript (String isJavaScript ) {
1385+ setIsJavaScriptValue (Boolean .parseBoolean (isJavaScript ));
1386+ }
1387+
1388+ public static void setIsJavaScriptValue (boolean isJavaScript ) {
1389+ ConfigConstants .isJavaScript = isJavaScript ;
1390+ }
1391+
1392+ @ Value ("${kk.xlsxallowedit:false}" )
1393+ public void setXlsxAllowEdit (String xlsxAllowEdit ) {
1394+ setXlsxAllowEditValue (Boolean .parseBoolean (xlsxAllowEdit ));
1395+ }
1396+
1397+ public static void setXlsxAllowEditValue (boolean xlsxAllowEdit ) {
1398+ ConfigConstants .xlsxAllowEdit = xlsxAllowEdit ;
1399+ }
1400+
1401+ @ Value ("${kk.xlsxshowtoolbar:false}" )
1402+ public void setXlsxShowtoolbar (String xlsxShowtoolbar ) {
1403+ setXlsxShowtoolbarValue (Boolean .parseBoolean (xlsxShowtoolbar ));
1404+ }
1405+
1406+ public static void setXlsxShowtoolbarValue (boolean xlsxShowtoolbar ) {
1407+ ConfigConstants .xlsxShowtoolbar = xlsxShowtoolbar ;
1408+ }
1409+
1410+ @ Value ("${kk.isshowkey:false}" )
1411+ public void setisShowKey (String isShowKey ) {
1412+ setisShowKeyValue (Boolean .parseBoolean (isShowKey ));
1413+ }
1414+
1415+ public static void setisShowKeyValue (boolean isShowKey ) {
1416+ ConfigConstants .isShowKey = isShowKey ;
1417+ }
1418+
1419+ @ Value ("${kk.scriptjs:false}" )
1420+ public void setscriptJs (String scriptJs ) {
1421+ setscriptJsValue (Boolean .parseBoolean (scriptJs ));
1422+ }
1423+
1424+ public static void setscriptJsValue (boolean scriptJs ) {
1425+ ConfigConstants .scriptJs = scriptJs ;
1426+ }
13081427}
0 commit comments