From 4907dafd807bcaca61cce738f08d092f52b856ca Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Thu, 10 Feb 2022 17:11:48 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97=EF=BC=8C=E6=9C=89=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E5=AF=B9=E8=B1=A1=E6=98=BE=E7=A4=BA=E4=BA=86=E7=BC=96?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1010178 --user=lyh 【系统管理】操作日志,有操作对象显示了编码 https://www.tapd.cn/55049933/s/1102773 --- .../metersphere/commons/constants/OperLogModule.java | 6 ++++++ .../io/metersphere/controller/UserController.java | 2 +- .../notice/controller/NoticeController.java | 5 +++-- .../controller/PerformanceReportController.java | 7 ++++--- .../controller/PerformanceTestController.java | 11 ++++++----- .../components/settings/operatinglog/config.js | 6 ++++++ frontend/src/i18n/en-US.js | 2 ++ frontend/src/i18n/zh-CN.js | 2 ++ frontend/src/i18n/zh-TW.js | 2 ++ 9 files changed, 32 insertions(+), 11 deletions(-) diff --git a/backend/src/main/java/io/metersphere/commons/constants/OperLogModule.java b/backend/src/main/java/io/metersphere/commons/constants/OperLogModule.java index ddaf050328..0cd2fafec8 100644 --- a/backend/src/main/java/io/metersphere/commons/constants/OperLogModule.java +++ b/backend/src/main/java/io/metersphere/commons/constants/OperLogModule.java @@ -30,6 +30,12 @@ public class OperLogModule { public static final String PERSONAL_INFORMATION_PERSONAL_SETTINGS = "PERSONAL_INFORMATION_PERSONAL_SETTINGS"; public static final String PERSONAL_INFORMATION_APIKEYS = "PERSONAL_INFORMATION_APIKEYS"; public static final String GROUP_PERMISSION = "GROUP_PERMISSION"; + public static final String PERFORMANCE_TEST_REPORT = "PERFORMANCE_TEST_REPORT"; + public static final String PERFORMANCE_TEST = "PERFORMANCE_TEST"; + public static final String ERROR_REPORT_LIBRARY = "ERROR_REPORT_LIBRARY"; + public static final String SYSTEM_QUOTA_MANAGEMENT = "SYSTEM_QUOTA_MANAGEMENT"; + public static final String ENTERPRISE_TEST_REPORT = "ENTERPRISE_TEST_REPORT"; + public static final String SYSTEM_AUTHORIZATION_MANAGEMENT = "SYSTEM_AUTHORIZATION_MANAGEMENT"; diff --git a/backend/src/main/java/io/metersphere/controller/UserController.java b/backend/src/main/java/io/metersphere/controller/UserController.java index f15a6932bc..44de68d8b4 100644 --- a/backend/src/main/java/io/metersphere/controller/UserController.java +++ b/backend/src/main/java/io/metersphere/controller/UserController.java @@ -211,7 +211,7 @@ public class UserController { * 修改当前用户密码 * */ @PostMapping("/update/password") - @MsAuditLog(module = "system_user", type = OperLogConstants.UPDATE, title = "个人密码") + @MsAuditLog(module = OperLogModule.SYSTEM_USER, type = OperLogConstants.UPDATE, title = "个人密码") public int updateCurrentUserPassword(@RequestBody EditPassWordRequest request) { return userService.updateCurrentUserPassword(request); } diff --git a/backend/src/main/java/io/metersphere/notice/controller/NoticeController.java b/backend/src/main/java/io/metersphere/notice/controller/NoticeController.java index 0ff3c75116..efd5b30723 100644 --- a/backend/src/main/java/io/metersphere/notice/controller/NoticeController.java +++ b/backend/src/main/java/io/metersphere/notice/controller/NoticeController.java @@ -1,6 +1,7 @@ package io.metersphere.notice.controller; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.log.annotation.MsAuditLog; import io.metersphere.notice.domain.MessageDetail; import io.metersphere.notice.service.NoticeService; @@ -16,7 +17,7 @@ public class NoticeController { private NoticeService noticeService; @PostMapping("save/message/task") - @MsAuditLog(module = "workspace_message_settings", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#messageDetail.id)", content = "#msClass.getLogDetails(#messageDetail.id)", msClass = NoticeService.class) + @MsAuditLog(module = OperLogModule.WORKSPACE_MESSAGE_SETTINGS, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#messageDetail.id)", content = "#msClass.getLogDetails(#messageDetail.id)", msClass = NoticeService.class) public void saveMessage(@RequestBody MessageDetail messageDetail) { noticeService.saveMessageTask(messageDetail); } @@ -32,7 +33,7 @@ public class NoticeController { } @GetMapping("/delete/message/{identification}") - @MsAuditLog(module = "workspace_message_settings", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#identification)", msClass = NoticeService.class) + @MsAuditLog(module = OperLogModule.WORKSPACE_MESSAGE_SETTINGS, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#identification)", msClass = NoticeService.class) public int deleteMessage(@PathVariable String identification) { return noticeService.delMessage(identification); } diff --git a/backend/src/main/java/io/metersphere/performance/controller/PerformanceReportController.java b/backend/src/main/java/io/metersphere/performance/controller/PerformanceReportController.java index 1c8f2e82a2..627f490f64 100644 --- a/backend/src/main/java/io/metersphere/performance/controller/PerformanceReportController.java +++ b/backend/src/main/java/io/metersphere/performance/controller/PerformanceReportController.java @@ -6,6 +6,7 @@ import io.metersphere.base.domain.LoadTestReportLog; import io.metersphere.base.domain.LoadTestReportWithBLOBs; import io.metersphere.commons.constants.NoticeConstants; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.constants.PermissionConstants; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; @@ -50,7 +51,7 @@ public class PerformanceReportController { @PostMapping("/delete/{reportId}") @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_REPORT_READ_DELETE) - @MsAuditLog(module = "performance_test_report", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#reportId)", msClass = PerformanceReportService.class) + @MsAuditLog(module = OperLogModule.PERFORMANCE_TEST_REPORT, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#reportId)", msClass = PerformanceReportService.class) @SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_REPORT_TASK, event = NoticeConstants.Event.DELETE, target = "#targetClass.getReport(#reportId)", targetClass = PerformanceReportService.class, mailTemplate = "performance/ReportDelete", subject = "性能测试报告通知") public void deleteReport(@PathVariable String reportId) { @@ -136,7 +137,7 @@ public class PerformanceReportController { @PostMapping("/batch/delete") @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_REPORT_READ_DELETE) - @MsAuditLog(module = "performance_test_report", type = OperLogConstants.BATCH_DEL, beforeEvent = "#msClass.getLogDetails(#reportRequest.ids)", msClass = PerformanceReportService.class) + @MsAuditLog(module = OperLogModule.PERFORMANCE_TEST_REPORT, type = OperLogConstants.BATCH_DEL, beforeEvent = "#msClass.getLogDetails(#reportRequest.ids)", msClass = PerformanceReportService.class) @SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_REPORT_TASK, event = NoticeConstants.Event.DELETE, target = "#targetClass.getReportList(#reportRequest.ids)", targetClass = PerformanceReportService.class, mailTemplate = "performance/ReportDelete", subject = "性能测试报告通知") public void deleteReportBatch(@RequestBody DeleteReportRequest reportRequest) { @@ -164,7 +165,7 @@ public class PerformanceReportController { } @PostMapping("rename") - @MsAuditLog(module = "performance_test_report", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = PerformanceReportService.class) + @MsAuditLog(module = OperLogModule.PERFORMANCE_TEST_REPORT, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = PerformanceReportService.class) public void renameReport(@RequestBody RenameReportRequest request) { performanceReportService.renameReport(request); } diff --git a/backend/src/main/java/io/metersphere/performance/controller/PerformanceTestController.java b/backend/src/main/java/io/metersphere/performance/controller/PerformanceTestController.java index a575c3b415..f34ac3153e 100644 --- a/backend/src/main/java/io/metersphere/performance/controller/PerformanceTestController.java +++ b/backend/src/main/java/io/metersphere/performance/controller/PerformanceTestController.java @@ -7,6 +7,7 @@ import io.metersphere.base.domain.LoadTest; import io.metersphere.base.domain.Schedule; import io.metersphere.commons.constants.NoticeConstants; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.constants.PermissionConstants; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; @@ -77,7 +78,7 @@ public class PerformanceTestController { } @PostMapping(value = "/save", consumes = {"multipart/form-data"}) - @MsAuditLog(module = "performance_test", type = OperLogConstants.CREATE, title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = PerformanceTestService.class) + @MsAuditLog(module = OperLogModule.PERFORMANCE_TEST, type = OperLogConstants.CREATE, title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = PerformanceTestService.class) @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_CREATE) @CacheNode // 把监控节点缓存起来 @SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_TEST_TASK, event = NoticeConstants.Event.CREATE, @@ -98,7 +99,7 @@ public class PerformanceTestController { } @PostMapping(value = "/edit", consumes = {"multipart/form-data"}) - @MsAuditLog(module = "performance_test", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = PerformanceTestService.class) + @MsAuditLog(module = OperLogModule.PERFORMANCE_TEST, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = PerformanceTestService.class) @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_EDIT) @CacheNode // 把监控节点缓存起来 @SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_TEST_TASK, event = NoticeConstants.Event.UPDATE, mailTemplate = "performance/TestUpdate", subject = "性能测试通知") @@ -155,7 +156,7 @@ public class PerformanceTestController { } @PostMapping("/delete") - @MsAuditLog(module = "performance_test", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#request.id)", msClass = PerformanceTestService.class) + @MsAuditLog(module = OperLogModule.PERFORMANCE_TEST, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#request.id)", msClass = PerformanceTestService.class) @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_DELETE) @CacheNode // 把监控节点缓存起来 @SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_TEST_TASK, event = NoticeConstants.Event.DELETE, @@ -166,7 +167,7 @@ public class PerformanceTestController { } @PostMapping("/run") - @MsAuditLog(module = "performance_test", type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.id)", msClass = PerformanceTestService.class) + @MsAuditLog(module = OperLogModule.PERFORMANCE_TEST, type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.id)", msClass = PerformanceTestService.class) @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_RUN) public String run(@RequestBody RunTestPlanRequest request) { return performanceTestService.run(request); @@ -208,7 +209,7 @@ public class PerformanceTestController { } @PostMapping(value = "/copy") - @MsAuditLog(module = "performance_test", type = OperLogConstants.COPY, content = "#msClass.getLogDetails(#request.id)", msClass = PerformanceTestService.class) + @MsAuditLog(module = OperLogModule.PERFORMANCE_TEST, type = OperLogConstants.COPY, content = "#msClass.getLogDetails(#request.id)", msClass = PerformanceTestService.class) @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_COPY) @CacheNode // 把监控节点缓存起来 public void copy(@RequestBody SaveTestPlanRequest request) { diff --git a/frontend/src/business/components/settings/operatinglog/config.js b/frontend/src/business/components/settings/operatinglog/config.js index 329793a1f4..0e5c1de84f 100644 --- a/frontend/src/business/components/settings/operatinglog/config.js +++ b/frontend/src/business/components/settings/operatinglog/config.js @@ -87,6 +87,12 @@ export function LOG_MODULE_MAP(_this) { ['PERSONAL_INFORMATION_PERSONAL_SETTINGS', _this.$t('operating_log.personal_information_personal_settings')], ['PERSONAL_INFORMATION_APIKEYS', _this.$t('operating_log.personal_information_apikeys')], ['GROUP_PERMISSION', _this.$t('operating_log.group_permission')], + ['PERFORMANCE_TEST_REPORT', _this.$t('operating_log.performance_test_report')], + ['PERFORMANCE_TEST', _this.$t('operating_log.performance_test')], + ['ERROR_REPORT_LIBRARY', _this.$t('operating_log.error_report_library')], + ['SYSTEM_QUOTA_MANAGEMENT', _this.$t('operating_log.system_quota_management')], + ['ENTERPRISE_TEST_REPORT', _this.$t('operating_log.enterprise_test_report')], + ['SYSTEM_AUTHORIZATION_MANAGEMENT', _this.$t('operating_log.system_authorization_management')], ]); return LOG_MODULE_MAP; } diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index e59e50e1cf..fc509226ae 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -2636,6 +2636,8 @@ export default { personal_information_apikeys: "Personal information API Keys", auth_title: "Auth", group_permission: "Group", + error_report_library: "Error report", + enterprise_test_report: "Enterprise report", change_history: "Change log", change_content: "Change content" }, diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index de67a2bcfc..8c4c510220 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -2639,6 +2639,8 @@ export default { personal_information_apikeys: "个人信息-API Keys", auth_title: "系统认证", group_permission: "用户组与权限", + error_report_library: "误报库", + enterprise_test_report: "项目报告", change_history: "变更记录", change_content: "变更内容" }, diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 783e4af948..c01b7ebdf5 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -2638,6 +2638,8 @@ export default { personal_information_apikeys: "個人信息-API Keys", auth_title: "系統認證", group_permission: "用戶組與權限", + error_report_library: "誤報庫", + enterprise_test_report: "項目報告", change_history: "變更記錄", change_content: "變更內容" },