From 2d66c2b0b6cd00e0bee592b70d4b98f614b5a559 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 31 Aug 2022 10:44:40 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wrapper/XssAndSqlHttpServletRequestWrapper.java | 2 -- .../main/java/io/dataease/job/sechedule/TestJob.java | 3 ++- .../java/io/dataease/listener/AppStartListener.java | 3 ++- .../dataease/listener/RowPermissionMergeListener.java | 3 --- .../java/io/dataease/listener/SystemInitListener.java | 3 --- .../provider/query/mongodb/MongoQueryProvider.java | 4 ---- .../io/dataease/service/chart/ChartViewService.java | 5 ----- .../dataease/service/dataset/ExtractDataService.java | 10 +++++----- .../io/dataease/service/dataset/PermissionService.java | 1 - .../java/io/dataease/service/sys/PluginService.java | 3 --- .../java/io/dataease/service/sys/SysUserService.java | 1 - .../java/io/dataease/service/sys/log/LogService.java | 2 -- 12 files changed, 9 insertions(+), 31 deletions(-) diff --git a/backend/src/main/java/io/dataease/commons/wrapper/XssAndSqlHttpServletRequestWrapper.java b/backend/src/main/java/io/dataease/commons/wrapper/XssAndSqlHttpServletRequestWrapper.java index a9251e291c..23236e1f44 100644 --- a/backend/src/main/java/io/dataease/commons/wrapper/XssAndSqlHttpServletRequestWrapper.java +++ b/backend/src/main/java/io/dataease/commons/wrapper/XssAndSqlHttpServletRequestWrapper.java @@ -168,9 +168,7 @@ public class XssAndSqlHttpServletRequestWrapper extends HttpServletRequestWrappe // NOTE: It's highly recommended to use the ESAPI library and // uncomment the following line to // avoid encoded attacks. - // value = ESAPI.encoder().canonicalize(value); // Avoid null characters - /** value = value.replaceAll("", ""); ***/ // Avoid anything between script tags Pattern scriptPattern = Pattern.compile( "<[\r\n| | ]*script[\r\n| | ]*>(.*?)", Pattern.CASE_INSENSITIVE); diff --git a/backend/src/main/java/io/dataease/job/sechedule/TestJob.java b/backend/src/main/java/io/dataease/job/sechedule/TestJob.java index d63802eb83..111dae0319 100644 --- a/backend/src/main/java/io/dataease/job/sechedule/TestJob.java +++ b/backend/src/main/java/io/dataease/job/sechedule/TestJob.java @@ -1,5 +1,6 @@ package io.dataease.job.sechedule; +import io.dataease.commons.utils.LogUtil; import org.quartz.JobExecutionContext; import java.text.SimpleDateFormat; @@ -12,6 +13,6 @@ import java.util.Date; public class TestJob extends DeScheduleJob { @Override void businessExecute(JobExecutionContext context) { - System.out.println("Test Job -- " + new SimpleDateFormat("HH:mm:ss").format(new Date())); + LogUtil.info("Test Job -- " + new SimpleDateFormat("HH:mm:ss").format(new Date())); } } diff --git a/backend/src/main/java/io/dataease/listener/AppStartListener.java b/backend/src/main/java/io/dataease/listener/AppStartListener.java index 0f6f831198..c19dbb0d8b 100644 --- a/backend/src/main/java/io/dataease/listener/AppStartListener.java +++ b/backend/src/main/java/io/dataease/listener/AppStartListener.java @@ -1,5 +1,6 @@ package io.dataease.listener; +import io.dataease.commons.utils.LogUtil; import io.dataease.plugins.common.base.domain.DatasetTableTask; import io.dataease.commons.constants.ScheduleType; import io.dataease.service.ScheduleService; @@ -23,7 +24,7 @@ public class AppStartListener implements ApplicationListener list = dataSetTableTaskService.list(new DatasetTableTask()); for (DatasetTableTask task : list) { diff --git a/backend/src/main/java/io/dataease/listener/RowPermissionMergeListener.java b/backend/src/main/java/io/dataease/listener/RowPermissionMergeListener.java index 204708fc47..800d5f15f7 100644 --- a/backend/src/main/java/io/dataease/listener/RowPermissionMergeListener.java +++ b/backend/src/main/java/io/dataease/listener/RowPermissionMergeListener.java @@ -31,12 +31,10 @@ public class RowPermissionMergeListener implements ApplicationListener beansOfType = SpringContextUtil.getApplicationContext().getBeansOfType((RowPermissionTreeService.class)); if (beansOfType.keySet().size() > 0) { - System.out.println("====row permissions merge [start]===="); logger.info("====row permissions merge [start]===="); SysStartupJob sysStartupJob = sysStartupJobMapper.selectByPrimaryKey(JOB_ID); if (ObjectUtils.isNotEmpty(sysStartupJob) && StringUtils.equalsIgnoreCase(sysStartupJob.getStatus(), "ready")) { - System.out.println("====row permissions merge [doing]===="); logger.info("====row permissions merge [doing]===="); RowPermissionTreeService rowPermissionTreeService = SpringContextUtil.getBean(RowPermissionTreeService.class); @@ -44,7 +42,6 @@ public class RowPermissionMergeListener implements ApplicationListener { chartCustomFilterDTO.setFieldId(field.getId()); if(datasetRowPermissions.getAuthTargetType().equalsIgnoreCase("sysParams")){ - System.out.println(values.get(chartCustomFilterDTO.getValue()).toString()); chartCustomFilterDTO.setValue(values.get(chartCustomFilterDTO.getValue()).toString()); } }); diff --git a/backend/src/main/java/io/dataease/service/sys/PluginService.java b/backend/src/main/java/io/dataease/service/sys/PluginService.java index 6f8b118046..9c570f4cfb 100644 --- a/backend/src/main/java/io/dataease/service/sys/PluginService.java +++ b/backend/src/main/java/io/dataease/service/sys/PluginService.java @@ -78,12 +78,10 @@ public class PluginService { String folder = pluginDir + "folder/"; try { ZipUtil.unzip(dest.getAbsolutePath(), folder); - // ZipUtils.unzip(dest, folder); } catch (Exception e) { DeFileUtils.deleteFile(pluginDir + "temp/"); DeFileUtils.deleteFile(folder); // 需要删除文件 - // e.printStackTrace(); LogUtil.error(e.getMessage(), e); DEException.throwException(e); } @@ -261,7 +259,6 @@ public class PluginService { } catch (InvocationTargetException e) { e.printStackTrace(); } - //BeanUtils.copyBean(result, myPlugin); if(result.getCategory().equalsIgnoreCase("datasource") && (StringUtils.isEmpty(result.getStore()) || !result.getStore().equalsIgnoreCase("default"))){ result.setStore("thirdpart"); } diff --git a/backend/src/main/java/io/dataease/service/sys/SysUserService.java b/backend/src/main/java/io/dataease/service/sys/SysUserService.java index 1206e01b13..97f27e9f53 100644 --- a/backend/src/main/java/io/dataease/service/sys/SysUserService.java +++ b/backend/src/main/java/io/dataease/service/sys/SysUserService.java @@ -140,7 +140,6 @@ public class SysUserService { sysUser.setLanguage("zh_CN"); sysUser.setFrom(3); sysUser.setIsAdmin(false); - // sysUser.setSub(ssoUserInfo.getSub()); sysUserMapper.insert(sysUser); SysUser dbUser = findOne(sysUser); if (null != dbUser && null != dbUser.getUserId()) { diff --git a/backend/src/main/java/io/dataease/service/sys/log/LogService.java b/backend/src/main/java/io/dataease/service/sys/log/LogService.java index 4a92767f15..795d94ea30 100644 --- a/backend/src/main/java/io/dataease/service/sys/log/LogService.java +++ b/backend/src/main/java/io/dataease/service/sys/log/LogService.java @@ -238,7 +238,6 @@ public class LogService { } public void saveLog(SysLogDTO sysLogDTO) { - // String ip = ""; CurrentUserDto user = AuthUtils.getUser(); SysLogWithBLOBs sysLogWithBLOBs = BeanUtils.copyBean(new SysLogWithBLOBs(), sysLogDTO); if (CollectionUtils.isNotEmpty(sysLogDTO.getPositions())) { @@ -258,7 +257,6 @@ public class LogService { sysLogWithBLOBs.setNickName(sysLogDTO.getSourceName()); } - // sysLogWithBLOBs.setIp(ip); sysLogMapper.insert(sysLogWithBLOBs); }