Procházet zdrojové kódy

fix: 日志中文符号解决

zhanghaijun před 2 roky
rodič
revize
6e036f4e33

+ 2 - 1
src/main/java/com/cec/plugins/service/task/SystemLogService.java

@@ -30,7 +30,8 @@ public class SystemLogService implements ApplicationRunner {
     public void run(ApplicationArguments args) throws Exception {
         redisClientSource.subscribe("LOGINFO", String.class, messageStr -> {
             log.info("订阅redis, key: {}, message: {}", "LOGINFO", messageStr);
-            SystemLogDto.LogItem logItem = JSONUtil.toBean(messageStr.replaceAll("“","\"").replaceAll("”","\""), SystemLogDto.LogItem.class);
+            String message = messageStr.replaceAll("[“|”]", "\"").replaceAll("[‘|’]", "'");
+            SystemLogDto.LogItem logItem = JSONUtil.toBean(message, SystemLogDto.LogItem.class);
             SystemLogDto dto = new SystemLogDto();
             String taskId = redisClientSource.getCacheStr(TaskEnum.TaskId.getKey());
             if (StrUtil.isBlank(taskId)) {