diff --git a/src/main/java/com/cym/controller/adminPage/ConfController.java b/src/main/java/com/cym/controller/adminPage/ConfController.java index b92f29038a0ac497deaab9e70b00e786be2b41d3..853ef9262efe886731f5d5ab8e1fe9118bd77f98 100644 --- a/src/main/java/com/cym/controller/adminPage/ConfController.java +++ b/src/main/java/com/cym/controller/adminPage/ConfController.java @@ -370,22 +370,17 @@ public class ConfController extends BaseController { // 检查命令格式 switch (cmd) { - case "pkill nginx": - return true; - case "taskkill /f /im nginx.exe": - return true; - case "systemctl stop nginx": - return true; - case "service nginx stop": - return true; - case "net stop nginx": - return true; - case "systemctl start nginx": - return true; - case "service nginx start": - return true; - case "net start nginx": - return true; + case "net start nginx": + case "service nginx start": + case "systemctl start nginx": + case "net stop nginx": + case "service nginx stop": + case "systemctl stop nginx": + case "taskkill /f /im nginx.exe": + case "pkill nginx": + return true; + default: + break; } String dir = ""; diff --git a/src/main/java/com/cym/controller/adminPage/HttpController.java b/src/main/java/com/cym/controller/adminPage/HttpController.java index c85b2b331ccaecc69928ef0ade1da88d618b8290..0ee4a1602a69da2a55e907bc58068825424e2889 100644 --- a/src/main/java/com/cym/controller/adminPage/HttpController.java +++ b/src/main/java/com/cym/controller/adminPage/HttpController.java @@ -88,7 +88,7 @@ public class HttpController extends BaseController { http.setName("map"); http.setValue("$http_upgrade $connection_upgrade {\r\n" // + " default upgrade;\r\n" // - + " '' close;\r\n" + "}\r\n" + "");// + + " '' close;\r\n" + "}\r\n");// http.setUnit(""); https.add(http); } diff --git a/src/main/java/com/cym/sqlhelper/utils/SqlHelper.java b/src/main/java/com/cym/sqlhelper/utils/SqlHelper.java index b56f9f0e3eed1cc21c5d72f27ceabea2a3944fb3..b8f88777f4d1629157bc556d2c6b794920aa1967 100644 --- a/src/main/java/com/cym/sqlhelper/utils/SqlHelper.java +++ b/src/main/java/com/cym/sqlhelper/utils/SqlHelper.java @@ -297,7 +297,7 @@ public class SqlHelper extends SqlUtils { paramValues.add(ReflectUtil.getFieldValue(object, field)); } } - paramValues.add((String) ReflectUtil.getFieldValue(object, "id")); + paramValues.add(ReflectUtil.getFieldValue(object, "id")); String sql = "UPDATE `" + StrUtil.toUnderlineCase(object.getClass().getSimpleName()) + "` SET " + StrUtil.join(",", fieldsPart) + " WHERE id = ?"; @@ -571,7 +571,7 @@ public class SqlHelper extends SqlUtils { * @return List 列表 */ public List findListByQuery(ConditionWrapper conditionWrapper, Class clazz) { - return (List) findListByQuery(conditionWrapper, null, clazz); + return findListByQuery(conditionWrapper, null, clazz); } /** @@ -583,7 +583,7 @@ public class SqlHelper extends SqlUtils { * @return List 列表 */ public List findListByQuery(Sort sort, Class clazz) { - return (List) findListByQuery(null, sort, clazz); + return findListByQuery(null, sort, clazz); } /** diff --git a/src/main/java/com/cym/utils/Crypt.java b/src/main/java/com/cym/utils/Crypt.java index 0ea2bd13872f69c7640a0992c6a9d0ad3cd71fcf..994c063594d5e46f2e031a5c2a2573a96efa3949 100644 --- a/src/main/java/com/cym/utils/Crypt.java +++ b/src/main/java/com/cym/utils/Crypt.java @@ -145,7 +145,7 @@ public class Crypt { 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A }; private static final int byteToUnsigned(byte b) { - int value = (int) b; + int value = b; return (value >= 0 ? value : value + 256); } diff --git a/src/main/java/com/cym/utils/PwdCheckUtil.java b/src/main/java/com/cym/utils/PwdCheckUtil.java index 87c9e2b3188695faf0644f1cb25d99f54d045e64..557408b2f8471179f73157b19ed9cfb4c8bd2569 100644 --- a/src/main/java/com/cym/utils/PwdCheckUtil.java +++ b/src/main/java/com/cym/utils/PwdCheckUtil.java @@ -169,7 +169,7 @@ public class PwdCheckUtil { * @return 含有横向连续字符串 返回true */ public static boolean checkLateralKeyboardSite(String password, int repetitions, boolean isLower) { - String t_password = new String(password); + String t_password = password; //将所有输入字符转为小写 t_password = t_password.toLowerCase(); int n = t_password.length(); @@ -232,7 +232,7 @@ public class PwdCheckUtil { * @throws */ public static boolean checkKeyboardSlantSite(String password, int repetitions, boolean isLower) { - String t_password = new String(password); + String t_password = password; t_password = t_password.toLowerCase(); int n = t_password.length(); /** @@ -288,7 +288,7 @@ public class PwdCheckUtil { * @throws */ public static boolean checkSequentialChars(String password, int repetitions, boolean isLower) { - String t_password = new String(password); + String t_password = password; boolean flag = false; int limit_num = repetitions; int normal_count = 0; @@ -333,7 +333,7 @@ public class PwdCheckUtil { * @throws */ public static boolean checkSequentialSameChars(String password, int repetitions) { - String t_password = new String(password); + String t_password = password; int n = t_password.length(); char[] pwdCharArr = t_password.toCharArray(); boolean flag = false; diff --git a/src/main/java/com/cym/utils/UpdateUtils.java b/src/main/java/com/cym/utils/UpdateUtils.java index d07c82970ff3450651116df78b76cfcfcd8b6b2c..c7845ef99846a86a573e2a929318354fbf11b298 100644 --- a/src/main/java/com/cym/utils/UpdateUtils.java +++ b/src/main/java/com/cym/utils/UpdateUtils.java @@ -37,7 +37,7 @@ public class UpdateUtils { String param = " --server.port=" + port + " --project.home=" + home; - if ("mysql".equals(type.toLowerCase())) { + if ("mysql".equalsIgnoreCase(type)) { param += " --spring.database.type=" + type // + " --spring.datasource.url=" + url // + " --spring.datasource.username=" + username //