From 3dc60a89e13224275f8f19a3e1bba82a19707330 Mon Sep 17 00:00:00 2001 From: octopus_yan Date: Sat, 19 Oct 2024 22:01:03 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BF=AE=E6=94=B9GUI=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- src/main/java/cn/octopusyan/alistgui/config/Constants.java | 3 +-- .../java/cn/octopusyan/alistgui/manager/ConfigManager.java | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 5a49883..a2a9479 100644 --- a/.gitignore +++ b/.gitignore @@ -6,8 +6,8 @@ target/ !.mvn/wrapper/maven-wrapper.jar !**/src/main/**/target/ !**/src/test/**/target/ -/config/ /bin/ +gui.yaml ### IntelliJ IDEA ### .idea/ diff --git a/src/main/java/cn/octopusyan/alistgui/config/Constants.java b/src/main/java/cn/octopusyan/alistgui/config/Constants.java index 59db2bd..7127f24 100644 --- a/src/main/java/cn/octopusyan/alistgui/config/Constants.java +++ b/src/main/java/cn/octopusyan/alistgui/config/Constants.java @@ -20,8 +20,7 @@ public class Constants { public static final String TMP_DIR_PATH = System.getProperty("java.io.tmpdir") + APP_NAME; public static final String ALIST_FILE = STR."\{BIN_DIR_PATH}\{File.separator}alist.exe"; - public static final String CONFIG_DIR_PATH = STR."\{DATA_DIR_PATH}\{File.separator}config"; - public static final String GUI_CONFIG_PATH = STR."\{CONFIG_DIR_PATH}\{File.separator}gui.yaml"; + public static final String GUI_CONFIG_PATH = STR."\{DATA_DIR_PATH}\{File.separator}gui.yaml"; public static final String BAK_FILE_PATH = STR."\{Constants.TMP_DIR_PATH}\{File.separator}bak"; public static final String REG_AUTO_RUN = "Software\\Microsoft\\Windows\\CurrentVersion\\Run"; diff --git a/src/main/java/cn/octopusyan/alistgui/manager/ConfigManager.java b/src/main/java/cn/octopusyan/alistgui/manager/ConfigManager.java index a5c87e6..80b5c36 100644 --- a/src/main/java/cn/octopusyan/alistgui/manager/ConfigManager.java +++ b/src/main/java/cn/octopusyan/alistgui/manager/ConfigManager.java @@ -84,10 +84,10 @@ public class ConfigManager { File parent = FileUtil.getParent(src, 1); if (!parent.exists()) { boolean wasSuccessful = parent.mkdirs(); - objectMapper.writeValue(src, clazz.getDeclaredConstructor().newInstance()); if (!wasSuccessful) logger.error("{} 创建失败", src.getAbsolutePath()); } + objectMapper.writeValue(src, clazz.getDeclaredConstructor().newInstance()); } public static void save() {