fix(系统设置): 操作日志,有操作对象显示了编码

--bug=1010178 --user=lyh 【系统管理】操作日志,有操作对象显示了编码
https://www.tapd.cn/55049933/s/1102773
This commit is contained in:
shiziyuan9527 2022-02-10 17:11:48 +08:00 committed by shiziyuan9527
parent bfd288ee77
commit 4907dafd80
9 changed files with 32 additions and 11 deletions

View File

@ -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_PERSONAL_SETTINGS = "PERSONAL_INFORMATION_PERSONAL_SETTINGS";
public static final String PERSONAL_INFORMATION_APIKEYS = "PERSONAL_INFORMATION_APIKEYS"; public static final String PERSONAL_INFORMATION_APIKEYS = "PERSONAL_INFORMATION_APIKEYS";
public static final String GROUP_PERMISSION = "GROUP_PERMISSION"; 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";

View File

@ -211,7 +211,7 @@ public class UserController {
* 修改当前用户密码 * 修改当前用户密码
* */ * */
@PostMapping("/update/password") @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) { public int updateCurrentUserPassword(@RequestBody EditPassWordRequest request) {
return userService.updateCurrentUserPassword(request); return userService.updateCurrentUserPassword(request);
} }

View File

@ -1,6 +1,7 @@
package io.metersphere.notice.controller; package io.metersphere.notice.controller;
import io.metersphere.commons.constants.OperLogConstants; import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.constants.OperLogModule;
import io.metersphere.log.annotation.MsAuditLog; import io.metersphere.log.annotation.MsAuditLog;
import io.metersphere.notice.domain.MessageDetail; import io.metersphere.notice.domain.MessageDetail;
import io.metersphere.notice.service.NoticeService; import io.metersphere.notice.service.NoticeService;
@ -16,7 +17,7 @@ public class NoticeController {
private NoticeService noticeService; private NoticeService noticeService;
@PostMapping("save/message/task") @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) { public void saveMessage(@RequestBody MessageDetail messageDetail) {
noticeService.saveMessageTask(messageDetail); noticeService.saveMessageTask(messageDetail);
} }
@ -32,7 +33,7 @@ public class NoticeController {
} }
@GetMapping("/delete/message/{identification}") @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) { public int deleteMessage(@PathVariable String identification) {
return noticeService.delMessage(identification); return noticeService.delMessage(identification);
} }

View File

@ -6,6 +6,7 @@ import io.metersphere.base.domain.LoadTestReportLog;
import io.metersphere.base.domain.LoadTestReportWithBLOBs; import io.metersphere.base.domain.LoadTestReportWithBLOBs;
import io.metersphere.commons.constants.NoticeConstants; import io.metersphere.commons.constants.NoticeConstants;
import io.metersphere.commons.constants.OperLogConstants; import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.constants.OperLogModule;
import io.metersphere.commons.constants.PermissionConstants; import io.metersphere.commons.constants.PermissionConstants;
import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager; import io.metersphere.commons.utils.Pager;
@ -50,7 +51,7 @@ public class PerformanceReportController {
@PostMapping("/delete/{reportId}") @PostMapping("/delete/{reportId}")
@RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_REPORT_READ_DELETE) @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, @SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_REPORT_TASK, event = NoticeConstants.Event.DELETE,
target = "#targetClass.getReport(#reportId)", targetClass = PerformanceReportService.class, mailTemplate = "performance/ReportDelete", subject = "性能测试报告通知") target = "#targetClass.getReport(#reportId)", targetClass = PerformanceReportService.class, mailTemplate = "performance/ReportDelete", subject = "性能测试报告通知")
public void deleteReport(@PathVariable String reportId) { public void deleteReport(@PathVariable String reportId) {
@ -136,7 +137,7 @@ public class PerformanceReportController {
@PostMapping("/batch/delete") @PostMapping("/batch/delete")
@RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_REPORT_READ_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, @SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_REPORT_TASK, event = NoticeConstants.Event.DELETE,
target = "#targetClass.getReportList(#reportRequest.ids)", targetClass = PerformanceReportService.class, mailTemplate = "performance/ReportDelete", subject = "性能测试报告通知") target = "#targetClass.getReportList(#reportRequest.ids)", targetClass = PerformanceReportService.class, mailTemplate = "performance/ReportDelete", subject = "性能测试报告通知")
public void deleteReportBatch(@RequestBody DeleteReportRequest reportRequest) { public void deleteReportBatch(@RequestBody DeleteReportRequest reportRequest) {
@ -164,7 +165,7 @@ public class PerformanceReportController {
} }
@PostMapping("rename") @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) { public void renameReport(@RequestBody RenameReportRequest request) {
performanceReportService.renameReport(request); performanceReportService.renameReport(request);
} }

View File

@ -7,6 +7,7 @@ import io.metersphere.base.domain.LoadTest;
import io.metersphere.base.domain.Schedule; import io.metersphere.base.domain.Schedule;
import io.metersphere.commons.constants.NoticeConstants; import io.metersphere.commons.constants.NoticeConstants;
import io.metersphere.commons.constants.OperLogConstants; import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.constants.OperLogModule;
import io.metersphere.commons.constants.PermissionConstants; import io.metersphere.commons.constants.PermissionConstants;
import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager; import io.metersphere.commons.utils.Pager;
@ -77,7 +78,7 @@ public class PerformanceTestController {
} }
@PostMapping(value = "/save", consumes = {"multipart/form-data"}) @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) @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_CREATE)
@CacheNode // 把监控节点缓存起来 @CacheNode // 把监控节点缓存起来
@SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_TEST_TASK, event = NoticeConstants.Event.CREATE, @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"}) @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) @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_EDIT)
@CacheNode // 把监控节点缓存起来 @CacheNode // 把监控节点缓存起来
@SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_TEST_TASK, event = NoticeConstants.Event.UPDATE, mailTemplate = "performance/TestUpdate", subject = "性能测试通知") @SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_TEST_TASK, event = NoticeConstants.Event.UPDATE, mailTemplate = "performance/TestUpdate", subject = "性能测试通知")
@ -155,7 +156,7 @@ public class PerformanceTestController {
} }
@PostMapping("/delete") @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) @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_DELETE)
@CacheNode // 把监控节点缓存起来 @CacheNode // 把监控节点缓存起来
@SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_TEST_TASK, event = NoticeConstants.Event.DELETE, @SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_TEST_TASK, event = NoticeConstants.Event.DELETE,
@ -166,7 +167,7 @@ public class PerformanceTestController {
} }
@PostMapping("/run") @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) @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_RUN)
public String run(@RequestBody RunTestPlanRequest request) { public String run(@RequestBody RunTestPlanRequest request) {
return performanceTestService.run(request); return performanceTestService.run(request);
@ -208,7 +209,7 @@ public class PerformanceTestController {
} }
@PostMapping(value = "/copy") @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) @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_COPY)
@CacheNode // 把监控节点缓存起来 @CacheNode // 把监控节点缓存起来
public void copy(@RequestBody SaveTestPlanRequest request) { public void copy(@RequestBody SaveTestPlanRequest request) {

View File

@ -87,6 +87,12 @@ export function LOG_MODULE_MAP(_this) {
['PERSONAL_INFORMATION_PERSONAL_SETTINGS', _this.$t('operating_log.personal_information_personal_settings')], ['PERSONAL_INFORMATION_PERSONAL_SETTINGS', _this.$t('operating_log.personal_information_personal_settings')],
['PERSONAL_INFORMATION_APIKEYS', _this.$t('operating_log.personal_information_apikeys')], ['PERSONAL_INFORMATION_APIKEYS', _this.$t('operating_log.personal_information_apikeys')],
['GROUP_PERMISSION', _this.$t('operating_log.group_permission')], ['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; return LOG_MODULE_MAP;
} }

View File

@ -2636,6 +2636,8 @@ export default {
personal_information_apikeys: "Personal information API Keys", personal_information_apikeys: "Personal information API Keys",
auth_title: "Auth", auth_title: "Auth",
group_permission: "Group", group_permission: "Group",
error_report_library: "Error report",
enterprise_test_report: "Enterprise report",
change_history: "Change log", change_history: "Change log",
change_content: "Change content" change_content: "Change content"
}, },

View File

@ -2639,6 +2639,8 @@ export default {
personal_information_apikeys: "个人信息-API Keys", personal_information_apikeys: "个人信息-API Keys",
auth_title: "系统认证", auth_title: "系统认证",
group_permission: "用户组与权限", group_permission: "用户组与权限",
error_report_library: "误报库",
enterprise_test_report: "项目报告",
change_history: "变更记录", change_history: "变更记录",
change_content: "变更内容" change_content: "变更内容"
}, },

View File

@ -2638,6 +2638,8 @@ export default {
personal_information_apikeys: "個人信息-API Keys", personal_information_apikeys: "個人信息-API Keys",
auth_title: "系統認證", auth_title: "系統認證",
group_permission: "用戶組與權限", group_permission: "用戶組與權限",
error_report_library: "誤報庫",
enterprise_test_report: "項目報告",
change_history: "變更記錄", change_history: "變更記錄",
change_content: "變更內容" change_content: "變更內容"
}, },