提交代码

master
姜玉琦 2024-03-10 00:57:26 +08:00
parent 22054bf3ee
commit 7faf93f596
7 changed files with 33 additions and 58 deletions

View File

@ -10,11 +10,11 @@ chestnut:
# 演示模式开关
demoMode: false
# 文件路径 示例( Windows配置D:/chestnut/uploadPathLinux配置 /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:

View File

@ -9,8 +9,8 @@ chestnut:
system:
# 演示模式开关
demoMode: true
# 文件路径 示例( Windows配置D:/chestnut/uploadPathLinux配置 /home/app/uploadPath
uploadPath: /home/app/uploadPath
# 文件路径 示例( Windows配置D:/chestnut/uploadPathLinux配置 /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

View File

@ -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());
});
}
}

View File

@ -100,9 +100,12 @@ public abstract class AsyncTask implements Runnable {
} else {
this.setStatus(TaskStatus.FAILED);
String err = e.getMessage();
if (e instanceof GlobalException ge && ge.getErrorCode() != null) {
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);
}
this.setPercent(100);

View File

@ -21,7 +21,9 @@ public class AsyncTaskExceptionHandler implements AsyncUncaughtExceptionHandler
@Override
public void handleUncaughtException(Throwable ex, Method method, Object... params) {
if (ArrayUtils.isNotEmpty(params) && params[0] instanceof AsyncTask task) {
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());
@ -29,4 +31,5 @@ public class AsyncTaskExceptionHandler implements AsyncUncaughtExceptionHandler
log.error("Async task failed{}", ex.getMessage());
}
}
}
}

View File

@ -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) {

View File

@ -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<SysMenuMapper, SysMenu> 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) {