diff --git a/YanZhuCMS/chestnut-admin/src/main/resources/application-dev.yml b/YanZhuCMS/chestnut-admin/src/main/resources/application-dev.yml index 4323bd5..aec0cd1 100644 --- a/YanZhuCMS/chestnut-admin/src/main/resources/application-dev.yml +++ b/YanZhuCMS/chestnut-admin/src/main/resources/application-dev.yml @@ -10,11 +10,11 @@ chestnut: # 演示模式开关 demoMode: false # 文件路径 示例( Windows配置D:/chestnut/uploadPath,Linux配置 /home/chestnut/uploadPath) - uploadPath: 'E:/dev/workspace_chestnut/uploadPath' + uploadPath: 'D:/dev/workspace_chestnut/uploadPath' # 验证码类型 math 数组计算 char 字符验证 captchaType: math member: - uploadPath: 'E:/dev/workspace_chestnut/_xy_member/' + uploadPath: 'D:/dev/workspace_chestnut/_xy_member/' # 开发环境配置 server: @@ -73,13 +73,13 @@ spring: data: redis: # 地址 - host: 140.143.157.1 + host: 127.0.0.1 # 端口,默认为6379 port: 6379 # 数据库索引 database: 15 # 密码 - password: x7Zhj3twzSdDwx2A + password: 123456 # 连接超时时间 timeout: 10s lettuce: diff --git a/YanZhuCMS/chestnut-admin/src/main/resources/application-prod.yml b/YanZhuCMS/chestnut-admin/src/main/resources/application-prod.yml index fb817e5..cd254b7 100644 --- a/YanZhuCMS/chestnut-admin/src/main/resources/application-prod.yml +++ b/YanZhuCMS/chestnut-admin/src/main/resources/application-prod.yml @@ -9,8 +9,8 @@ chestnut: system: # 演示模式开关 demoMode: true - # 文件路径 示例( Windows配置D:/chestnut/uploadPath,Linux配置 /home/app/uploadPath) - uploadPath: /home/app/uploadPath + # 文件路径 示例( Windows配置D:/chestnut/uploadPath,Linux配置 /home/app/data) + uploadPath: /home/app/data # 验证码类型 math 数组计算 char 字符验证 captchaType: math freemarker: @@ -23,7 +23,7 @@ chestnut: # 开发环境配置 server: # 服务器的HTTP端口,默认为8090 - port: 8090 + port: 8081 servlet: # 应用的访问路径 context-path: / @@ -72,13 +72,13 @@ spring: data: redis: # 地址 - host: 140.143.157.1 + host: 127.0.0.1 # 端口,默认为6379 port: 6379 # 数据库索引 database: 15 # 密码 - password: x7Zhj3twzSdDwx2A + password: 123456 # 连接超时时间 timeout: 10s lettuce: @@ -236,7 +236,7 @@ xxl: ### 执行器端口号 [选填]:小于等于0则自动获取;默认端口为9999,单机部署多个执行器时,注意要配置不同执行器端口; port: 9968 ### 执行器运行日志文件存储磁盘路径 [选填] :需要对该路径拥有读写权限;为空则使用默认路径; - logpath: E:/dev/workspace_chestnut/ChestnutCMS/chestnut-modules/chestnut-xxljob/jobhandler + logpath: /home/app/logs/chestnut-modules/chestnut-xxljob/jobhandler ### 执行器日志文件保存天数 [选填] : 过期日志自动清理, 限制值大于等于3时生效; 否则, 如-1, 关闭自动清理功能;默认:30 logretentiondays: 30 diff --git a/YanZhuCMS/chestnut-admin/src/test/java/com/chestnut/member/MemberTest.java b/YanZhuCMS/chestnut-admin/src/test/java/com/chestnut/member/MemberTest.java deleted file mode 100644 index 4fd1f05..0000000 --- a/YanZhuCMS/chestnut-admin/src/test/java/com/chestnut/member/MemberTest.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.chestnut.member; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; - -import com.chestnut.member.domain.Member; -import com.chestnut.member.service.IMemberExpConfigService; -import com.chestnut.member.service.IMemberService; - -@SpringBootTest -public class MemberTest { - - @Autowired - private IMemberService memberService; - - @Autowired - private IMemberExpConfigService expConfigService; - - @Test - void testMemberSignIn() { - Member member = this.memberService.getById(398339741712453L); - - expConfigService.list().forEach(expConfig -> { - - expConfigService.triggerExpOperation(expConfig.getOpType(), member.getMemberId()); - }); - } -} diff --git a/YanZhuCMS/chestnut-common/chestnut-common-core/src/main/java/com/chestnut/common/async/AsyncTask.java b/YanZhuCMS/chestnut-common/chestnut-common-core/src/main/java/com/chestnut/common/async/AsyncTask.java index ebcf920..da03edf 100644 --- a/YanZhuCMS/chestnut-common/chestnut-common-core/src/main/java/com/chestnut/common/async/AsyncTask.java +++ b/YanZhuCMS/chestnut-common/chestnut-common-core/src/main/java/com/chestnut/common/async/AsyncTask.java @@ -100,8 +100,11 @@ public abstract class AsyncTask implements Runnable { } else { this.setStatus(TaskStatus.FAILED); String err = e.getMessage(); - if (e instanceof GlobalException ge && ge.getErrorCode() != null) { - err = I18nUtils.get(ge.getErrorCode().value(), LocaleContextHolder.getLocale(), ge.getErrArgs()); + if (e instanceof GlobalException) { + GlobalException ge = (GlobalException)e; + if(ge!=null && ge.getErrArgs()!=null){ + err = I18nUtils.get(ge.getErrorCode().value(), LocaleContextHolder.getLocale(), ge.getErrArgs()); + } } this.addErrorMessage(err); } diff --git a/YanZhuCMS/chestnut-common/chestnut-common-core/src/main/java/com/chestnut/common/async/AsyncTaskExceptionHandler.java b/YanZhuCMS/chestnut-common/chestnut-common-core/src/main/java/com/chestnut/common/async/AsyncTaskExceptionHandler.java index 266ddc6..d5f0fdc 100644 --- a/YanZhuCMS/chestnut-common/chestnut-common-core/src/main/java/com/chestnut/common/async/AsyncTaskExceptionHandler.java +++ b/YanZhuCMS/chestnut-common/chestnut-common-core/src/main/java/com/chestnut/common/async/AsyncTaskExceptionHandler.java @@ -21,12 +21,15 @@ public class AsyncTaskExceptionHandler implements AsyncUncaughtExceptionHandler @Override public void handleUncaughtException(Throwable ex, Method method, Object... params) { - if (ArrayUtils.isNotEmpty(params) && params[0] instanceof AsyncTask task) { - task.setStatus(TaskStatus.FAILED); - task.setEndTime(LocalDateTime.now()); - task.addErrorMessage(ex.getMessage()); - AsyncTaskManager.setTaskMessage("Async task failed:" + ex.getMessage()); - log.error("Async task failed:{}", ex.getMessage()); + if (ArrayUtils.isNotEmpty(params) && params[0] instanceof AsyncTask) { + AsyncTask task = (AsyncTask)params[0]; + if(task!=null){ + task.setStatus(TaskStatus.FAILED); + task.setEndTime(LocalDateTime.now()); + task.addErrorMessage(ex.getMessage()); + AsyncTaskManager.setTaskMessage("Async task failed:" + ex.getMessage()); + log.error("Async task failed:{}", ex.getMessage()); + } } } } diff --git a/YanZhuCMS/chestnut-common/chestnut-common-core/src/main/java/com/chestnut/common/utils/ConvertUtils.java b/YanZhuCMS/chestnut-common/chestnut-common-core/src/main/java/com/chestnut/common/utils/ConvertUtils.java index 4fa1b2c..89aa685 100644 --- a/YanZhuCMS/chestnut-common/chestnut-common-core/src/main/java/com/chestnut/common/utils/ConvertUtils.java +++ b/YanZhuCMS/chestnut-common/chestnut-common-core/src/main/java/com/chestnut/common/utils/ConvertUtils.java @@ -71,13 +71,13 @@ public class ConvertUtils { * @return */ public static Boolean toBoolean(String str, boolean defaultV) { - return switch(str) { - case "true" -> Boolean.TRUE; - case "false" -> Boolean.FALSE; - case "1" -> Boolean.TRUE; - case "0" -> Boolean.FALSE; - default -> defaultV; - }; + switch(str) { + case "true" : return Boolean.TRUE; + case "false" : return Boolean.FALSE; + case "1" : return Boolean.TRUE; + case "0" : return Boolean.FALSE; + default : return defaultV; + } } public static Boolean toBoolean(Object obj, boolean defaultV) { diff --git a/YanZhuCMS/chestnut-modules/chestnut-system/src/main/java/com/chestnut/system/service/impl/SysMenuServiceImpl.java b/YanZhuCMS/chestnut-modules/chestnut-system/src/main/java/com/chestnut/system/service/impl/SysMenuServiceImpl.java index f6a24b3..62aaea6 100644 --- a/YanZhuCMS/chestnut-modules/chestnut-system/src/main/java/com/chestnut/system/service/impl/SysMenuServiceImpl.java +++ b/YanZhuCMS/chestnut-modules/chestnut-system/src/main/java/com/chestnut/system/service/impl/SysMenuServiceImpl.java @@ -26,10 +26,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; /** @@ -170,7 +167,7 @@ public class SysMenuServiceImpl extends ServiceImpl impl i18nDict.setLangKey("MENU.NAME." + menu.getMenuId()); i18nDict.setLangTag(LocaleContextHolder.getLocale().toLanguageTag()); i18nDict.setLangValue(menu.getMenuName()); - i18nDictService.batchSaveI18nDicts(List.of(i18nDict)); + i18nDictService.batchSaveI18nDicts(Arrays.asList(i18nDict)); } private boolean checkMenuUnique(String menuName, Long parentId, Long menuId) {