浏览代码

controller补全操作日志

xusl 1 年之前
父节点
当前提交
140dc75fd7
共有 25 个文件被更改,包括 172 次插入92 次删除
  1. 4 1
      backend/src/main/java/com/jiayue/ssi/annotation/OperateLog.java
  2. 2 0
      backend/src/main/java/com/jiayue/ssi/aspectj/OperateLogAspect.java
  3. 20 0
      backend/src/main/java/com/jiayue/ssi/backenum/BusinessType.java
  4. 3 1
      backend/src/main/java/com/jiayue/ssi/config/MyAuthenticationProvider.java
  5. 2 1
      backend/src/main/java/com/jiayue/ssi/controller/ElectricFieldController.java
  6. 4 0
      backend/src/main/java/com/jiayue/ssi/controller/ForecastPowerShortTermController.java
  7. 3 2
      backend/src/main/java/com/jiayue/ssi/controller/IpBlacklistController.java
  8. 4 0
      backend/src/main/java/com/jiayue/ssi/controller/NwpController.java
  9. 4 0
      backend/src/main/java/com/jiayue/ssi/controller/ServerController.java
  10. 5 0
      backend/src/main/java/com/jiayue/ssi/controller/SysAlarmController.java
  11. 2 1
      backend/src/main/java/com/jiayue/ssi/controller/SysApproveController.java
  12. 4 2
      backend/src/main/java/com/jiayue/ssi/controller/SysLogininforController.java
  13. 6 3
      backend/src/main/java/com/jiayue/ssi/controller/SysMenuController.java
  14. 4 2
      backend/src/main/java/com/jiayue/ssi/controller/SysOperlogController.java
  15. 4 3
      backend/src/main/java/com/jiayue/ssi/controller/SysParameterController.java
  16. 2 1
      backend/src/main/java/com/jiayue/ssi/controller/SysPolicyController.java
  17. 6 3
      backend/src/main/java/com/jiayue/ssi/controller/SysRoleController.java
  18. 11 8
      backend/src/main/java/com/jiayue/ssi/controller/SysUserController.java
  19. 3 0
      backend/src/main/java/com/jiayue/ssi/controller/UserLoginController.java
  20. 11 0
      backend/src/main/java/com/jiayue/ssi/entity/SysOperLog.java
  21. 1 1
      backend/src/main/java/com/jiayue/ssi/filter/MailCodeFilter.java
  22. 2 1
      backend/src/main/java/com/jiayue/ssi/filter/VerifyCodeFilter.java
  23. 1 1
      backend/src/main/java/com/jiayue/ssi/filter/VerifySmFilter.java
  24. 14 8
      backend/src/test/java/com/jiayue/ssi/service/Sm2UiTest.java
  25. 50 53
      ui/src/App.vue

+ 4 - 1
backend/src/main/java/com/jiayue/ssi/annotation/OperateLog.java

@@ -26,7 +26,10 @@ public @interface OperateLog
      * 功能
      * 功能
      */
      */
     public BusinessType businessType() default BusinessType.OTHER;
     public BusinessType businessType() default BusinessType.OTHER;
-
+    /**
+     * 操作描述
+     */
+    public String operdesc() default "";
     /**
     /**
      * 审计类型
      * 审计类型
      */
      */

+ 2 - 0
backend/src/main/java/com/jiayue/ssi/aspectj/OperateLogAspect.java

@@ -141,6 +141,8 @@ public class OperateLogAspect {
         operLog.setBusinessType(log.businessType().ordinal());
         operLog.setBusinessType(log.businessType().ordinal());
         // 设置标题
         // 设置标题
         operLog.setTitle(log.title());
         operLog.setTitle(log.title());
+        // 操作描述
+        operLog.setOperdesc(log.operdesc());
         // 审计类型
         // 审计类型
         operLog.setAuditType(log.auditType().ordinal());
         operLog.setAuditType(log.auditType().ordinal());
         // 设置操作人类别
         // 设置操作人类别

+ 20 - 0
backend/src/main/java/com/jiayue/ssi/backenum/BusinessType.java

@@ -8,9 +8,21 @@ package com.jiayue.ssi.backenum;
 public enum BusinessType
 public enum BusinessType
 {
 {
     /**
     /**
+     * 查询
+     */
+    QUERY,
+    /**
+     * 解锁
+     */
+    UNLOCK,
+    /**
      * 其它
      * 其它
      */
      */
     OTHER,
     OTHER,
+    /**
+     * 初始/重置密码
+     */
+    RESETPWD,
 
 
     /**
     /**
      * 新增
      * 新增
@@ -21,6 +33,10 @@ public enum BusinessType
      * 修改
      * 修改
      */
      */
     UPDATE,
     UPDATE,
+    /**
+     * 个人密码修改
+     */
+    PWDUPDATE,
 
 
     /**
     /**
      * 删除
      * 删除
@@ -31,6 +47,10 @@ public enum BusinessType
      * 授权
      * 授权
      */
      */
     GRANT,
     GRANT,
+    /**
+     * 获取角色信息
+     */
+    GETROLE,
 
 
     /**
     /**
      * 导出
      * 导出

+ 3 - 1
backend/src/main/java/com/jiayue/ssi/config/MyAuthenticationProvider.java

@@ -3,6 +3,7 @@ package com.jiayue.ssi.config;
 import cn.hutool.crypto.SmUtil;
 import cn.hutool.crypto.SmUtil;
 import com.jiayue.ssi.constant.SecretKeyConstants;
 import com.jiayue.ssi.constant.SecretKeyConstants;
 import com.jiayue.ssi.util.SM2CryptUtils;
 import com.jiayue.ssi.util.SM2CryptUtils;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.security.authentication.BadCredentialsException;
 import org.springframework.security.authentication.BadCredentialsException;
 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
 import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
 import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
@@ -18,6 +19,7 @@ import javax.annotation.Resource;
 * @author xsl
 * @author xsl
 * @since 2023/03/13
 * @since 2023/03/13
 */
 */
+@Slf4j
 public class MyAuthenticationProvider extends DaoAuthenticationProvider {
 public class MyAuthenticationProvider extends DaoAuthenticationProvider {
 
 
     @Resource
     @Resource
@@ -36,7 +38,7 @@ public class MyAuthenticationProvider extends DaoAuthenticationProvider {
             try {
             try {
                 decryptPassword= SmUtil.sm3(presentedPassword).toUpperCase();
                 decryptPassword= SmUtil.sm3(presentedPassword).toUpperCase();
             } catch (Exception e) {
             } catch (Exception e) {
-                e.printStackTrace();
+                log.error("用户密码解密错误,无法登录!");
             }
             }
 //            if (!this.passwordEncoder.matches(decryptPassword, userDetails.getPassword())) {
 //            if (!this.passwordEncoder.matches(decryptPassword, userDetails.getPassword())) {
 //                this.logger.debug("Authentication failed: password does not match stored value");
 //                this.logger.debug("Authentication failed: password does not match stored value");

+ 2 - 1
backend/src/main/java/com/jiayue/ssi/controller/ElectricFieldController.java

@@ -37,6 +37,7 @@ public class ElectricFieldController {
      */
      */
     @GetMapping(value = "/getAll")
     @GetMapping(value = "/getAll")
     @PreAuthorize("@ss.hasPermi('biz:electric:getAll')")
     @PreAuthorize("@ss.hasPermi('biz:electric:getAll')")
+    @OperateLog(title = "场站管理", businessType = BusinessType.QUERY, auditType = AuditType.BIZ,operdesc = "查询场站信息")
     @PreventReplay
     @PreventReplay
     public ResponseVO getAll() throws CustomException {
     public ResponseVO getAll() throws CustomException {
         try {
         try {
@@ -51,7 +52,7 @@ public class ElectricFieldController {
      * 保存场站
      * 保存场站
      */
      */
     @PostMapping
     @PostMapping
-    @OperateLog(title = "场站信息", businessType = BusinessType.UPDATE, auditType = AuditType.BIZ)
+    @OperateLog(title = "场站信息", businessType = BusinessType.UPDATE, auditType = AuditType.BIZ,operdesc = "保存场站信息")
     @PreAuthorize("@ss.hasPermi('biz:electric:update')")
     @PreAuthorize("@ss.hasPermi('biz:electric:update')")
     @PreventReplay
     @PreventReplay
     public ResponseVO update(@RequestBody ElectricField electricField) throws CustomException {
     public ResponseVO update(@RequestBody ElectricField electricField) throws CustomException {

+ 4 - 0
backend/src/main/java/com/jiayue/ssi/controller/ForecastPowerShortTermController.java

@@ -3,7 +3,10 @@ package com.jiayue.ssi.controller;
 import cn.hutool.core.util.NumberUtil;
 import cn.hutool.core.util.NumberUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jiayue.ssi.annotation.OperateLog;
 import com.jiayue.ssi.annotation.PreventReplay;
 import com.jiayue.ssi.annotation.PreventReplay;
+import com.jiayue.ssi.backenum.AuditType;
+import com.jiayue.ssi.backenum.BusinessType;
 import com.jiayue.ssi.constant.CustomException;
 import com.jiayue.ssi.constant.CustomException;
 import com.jiayue.ssi.entity.*;
 import com.jiayue.ssi.entity.*;
 import com.jiayue.ssi.service.*;
 import com.jiayue.ssi.service.*;
@@ -39,6 +42,7 @@ public class ForecastPowerShortTermController {
      */
      */
     @GetMapping(value = "/getAll")
     @GetMapping(value = "/getAll")
     @PreAuthorize("@ss.hasPermi('biz:dq:getAll')")
     @PreAuthorize("@ss.hasPermi('biz:dq:getAll')")
+    @OperateLog(title = "短期预测", businessType = BusinessType.QUERY, auditType = AuditType.BIZ,operdesc = "查询短期预测数据")
     @PreventReplay
     @PreventReplay
     public ResponseVO getAll(String currentPage, String pageSize, String startTime, String endTime) throws CustomException {
     public ResponseVO getAll(String currentPage, String pageSize, String startTime, String endTime) throws CustomException {
         try {
         try {

+ 3 - 2
backend/src/main/java/com/jiayue/ssi/controller/IpBlacklistController.java

@@ -42,6 +42,7 @@ public class IpBlacklistController {
      */
      */
     @GetMapping(value = "/getAll")
     @GetMapping(value = "/getAll")
     @PreAuthorize("@ss.hasPermi('system:ipblacklist:list')")
     @PreAuthorize("@ss.hasPermi('system:ipblacklist:list')")
+    @OperateLog(title = "短期预测", businessType = BusinessType.QUERY, auditType = AuditType.SYS,operdesc = "查询黑名单列表")
     @PreventReplay
     @PreventReplay
     public ResponseVO getAll(String currentPage, String pageSize, String ip) throws CustomException {
     public ResponseVO getAll(String currentPage, String pageSize, String ip) throws CustomException {
         try {
         try {
@@ -89,7 +90,7 @@ public class IpBlacklistController {
      * 新增ip
      * 新增ip
      */
      */
     @PostMapping(value = "/addIp")
     @PostMapping(value = "/addIp")
-    @OperateLog(title = "黑名单管理", businessType = BusinessType.INSERT, auditType = AuditType.SYS)
+    @OperateLog(title = "黑名单管理", businessType = BusinessType.INSERT, auditType = AuditType.SYS,operdesc = "新增黑名单")
     @PreAuthorize("@ss.hasPermi('system:ipblacklist:add')")
     @PreAuthorize("@ss.hasPermi('system:ipblacklist:add')")
     @PreventReplay
     @PreventReplay
     public ResponseVO addIp(@RequestBody SysBlacklist sysBlacklist) throws CustomException {
     public ResponseVO addIp(@RequestBody SysBlacklist sysBlacklist) throws CustomException {
@@ -125,7 +126,7 @@ public class IpBlacklistController {
      * 删除用户信息
      * 删除用户信息
      */
      */
     @PostMapping(value = "/delIp")
     @PostMapping(value = "/delIp")
-    @OperateLog(title = "黑名单管理", businessType = BusinessType.DELETE, auditType = AuditType.SYS)
+    @OperateLog(title = "黑名单管理", businessType = BusinessType.DELETE, auditType = AuditType.SYS,operdesc = "删除黑名单")
     @PreAuthorize("@ss.hasPermi('system:ipblacklist:remove')")
     @PreAuthorize("@ss.hasPermi('system:ipblacklist:remove')")
     @PreventReplay
     @PreventReplay
     public ResponseVO delIp(String id) throws CustomException {
     public ResponseVO delIp(String id) throws CustomException {

+ 4 - 0
backend/src/main/java/com/jiayue/ssi/controller/NwpController.java

@@ -3,7 +3,10 @@ package com.jiayue.ssi.controller;
 import cn.hutool.core.util.NumberUtil;
 import cn.hutool.core.util.NumberUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jiayue.ssi.annotation.OperateLog;
 import com.jiayue.ssi.annotation.PreventReplay;
 import com.jiayue.ssi.annotation.PreventReplay;
+import com.jiayue.ssi.backenum.AuditType;
+import com.jiayue.ssi.backenum.BusinessType;
 import com.jiayue.ssi.constant.CustomException;
 import com.jiayue.ssi.constant.CustomException;
 import com.jiayue.ssi.entity.Nwp;
 import com.jiayue.ssi.entity.Nwp;
 import com.jiayue.ssi.service.NwpService;
 import com.jiayue.ssi.service.NwpService;
@@ -42,6 +45,7 @@ public class NwpController {
      */
      */
     @GetMapping(value = "/getAll")
     @GetMapping(value = "/getAll")
     @PreAuthorize("@ss.hasPermi('biz:nwp:getAll')")
     @PreAuthorize("@ss.hasPermi('biz:nwp:getAll')")
+    @OperateLog(title = "NWP预测", businessType = BusinessType.QUERY, auditType = AuditType.BIZ,operdesc = "查询NWP预测数据")
     @PreventReplay
     @PreventReplay
     public ResponseVO getAll(String currentPage, String pageSize, String startTime, String endTime) throws CustomException {
     public ResponseVO getAll(String currentPage, String pageSize, String startTime, String endTime) throws CustomException {
         try {
         try {

+ 4 - 0
backend/src/main/java/com/jiayue/ssi/controller/ServerController.java

@@ -1,6 +1,9 @@
 package com.jiayue.ssi.controller;
 package com.jiayue.ssi.controller;
 
 
+import com.jiayue.ssi.annotation.OperateLog;
 import com.jiayue.ssi.annotation.PreventReplay;
 import com.jiayue.ssi.annotation.PreventReplay;
+import com.jiayue.ssi.backenum.AuditType;
+import com.jiayue.ssi.backenum.BusinessType;
 import com.jiayue.ssi.constant.CustomException;
 import com.jiayue.ssi.constant.CustomException;
 import com.jiayue.ssi.entity.Server;
 import com.jiayue.ssi.entity.Server;
 import com.jiayue.ssi.util.ResponseVO;
 import com.jiayue.ssi.util.ResponseVO;
@@ -22,6 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
 public class ServerController {
 public class ServerController {
     @PreAuthorize("@ss.hasPermi('monitor:server:list')")
     @PreAuthorize("@ss.hasPermi('monitor:server:list')")
     @GetMapping()
     @GetMapping()
+    @OperateLog(title = "服务监控", businessType = BusinessType.QUERY, auditType = AuditType.SYS,operdesc = "获取服务监控信息")
     @PreventReplay
     @PreventReplay
     public ResponseVO getInfo() throws CustomException {
     public ResponseVO getInfo() throws CustomException {
         try {
         try {

+ 5 - 0
backend/src/main/java/com/jiayue/ssi/controller/SysAlarmController.java

@@ -2,7 +2,10 @@ package com.jiayue.ssi.controller;
 
 
 import cn.hutool.core.util.NumberUtil;
 import cn.hutool.core.util.NumberUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.jiayue.ssi.annotation.OperateLog;
 import com.jiayue.ssi.annotation.PreventReplay;
 import com.jiayue.ssi.annotation.PreventReplay;
+import com.jiayue.ssi.backenum.AuditType;
+import com.jiayue.ssi.backenum.BusinessType;
 import com.jiayue.ssi.constant.CustomException;
 import com.jiayue.ssi.constant.CustomException;
 import com.jiayue.ssi.entity.SysAlarm;
 import com.jiayue.ssi.entity.SysAlarm;
 import com.jiayue.ssi.service.SysAlarmService;
 import com.jiayue.ssi.service.SysAlarmService;
@@ -32,6 +35,7 @@ public class SysAlarmController {
      * @return
      * @return
      */
      */
     @GetMapping(value = "/getAll")
     @GetMapping(value = "/getAll")
+    @OperateLog(title = "告警管理", businessType = BusinessType.QUERY, auditType = AuditType.SYS,operdesc = "获取告警信息列表")
     @PreventReplay
     @PreventReplay
     public ResponseVO getAll() throws CustomException {
     public ResponseVO getAll() throws CustomException {
         try {
         try {
@@ -48,6 +52,7 @@ public class SysAlarmController {
      * 查收提交
      * 查收提交
      */
      */
     @PostMapping(value = "/readDone")
     @PostMapping(value = "/readDone")
+    @OperateLog(title = "告警管理", businessType = BusinessType.UPDATE, auditType = AuditType.SYS,operdesc = "查收告警信息")
     @PreventReplay
     @PreventReplay
     public ResponseVO readDone(String id) throws CustomException {
     public ResponseVO readDone(String id) throws CustomException {
         try {
         try {

+ 2 - 1
backend/src/main/java/com/jiayue/ssi/controller/SysApproveController.java

@@ -50,6 +50,7 @@ public class SysApproveController {
      */
      */
     @GetMapping(value = "/getAll")
     @GetMapping(value = "/getAll")
     @PreAuthorize("@ss.hasPermi('approveManager:approve:list')")
     @PreAuthorize("@ss.hasPermi('approveManager:approve:list')")
+    @OperateLog(title = "审核管理", businessType = BusinessType.QUERY, auditType = AuditType.SYS,operdesc = "查询审核列表")
     @PreventReplay
     @PreventReplay
     public ResponseVO getAll(String currentPage, String pageSize, String approveStatus, String approveResult) throws CustomException {
     public ResponseVO getAll(String currentPage, String pageSize, String approveStatus, String approveResult) throws CustomException {
         try {
         try {
@@ -235,7 +236,7 @@ public class SysApproveController {
      * 审批结果提交
      * 审批结果提交
      */
      */
     @PostMapping(value = "/submitApprove")
     @PostMapping(value = "/submitApprove")
-    @OperateLog(title = "审核管理", businessType = BusinessType.UPDATE, auditType = AuditType.SYS)
+    @OperateLog(title = "审核管理", businessType = BusinessType.UPDATE, auditType = AuditType.SYS,operdesc = "审核结果提交")
     @PreAuthorize("@ss.hasPermi('approveManager:approve:submitApprove')")
     @PreAuthorize("@ss.hasPermi('approveManager:approve:submitApprove')")
     @PreventReplay
     @PreventReplay
     public ResponseVO submitApprove(@RequestBody SysApprove sysApprove) throws CustomException {
     public ResponseVO submitApprove(@RequestBody SysApprove sysApprove) throws CustomException {

+ 4 - 2
backend/src/main/java/com/jiayue/ssi/controller/SysLogininforController.java

@@ -41,6 +41,7 @@ public class SysLogininforController {
      */
      */
     @GetMapping(value = "/getAll")
     @GetMapping(value = "/getAll")
     @PreAuthorize("@ss.hasPermi('auditManager:logininfor:list')")
     @PreAuthorize("@ss.hasPermi('auditManager:logininfor:list')")
+    @OperateLog(title = "登录日志", businessType = BusinessType.QUERY, auditType = AuditType.SYS,operdesc = "查询登录日志")
     @PreventReplay
     @PreventReplay
     public ResponseVO getAll(String currentPage, String pageSize, String ipaddr, String userName,
     public ResponseVO getAll(String currentPage, String pageSize, String ipaddr, String userName,
                              String status, String startLoginTime, String endLoginTime, String sortOrder) throws CustomException {
                              String status, String startLoginTime, String endLoginTime, String sortOrder) throws CustomException {
@@ -125,7 +126,7 @@ public class SysLogininforController {
      * 删除登录信息
      * 删除登录信息
      */
      */
     @PostMapping(value = "/delLoginInfo")
     @PostMapping(value = "/delLoginInfo")
-    @OperateLog(title = "登录日志", businessType = BusinessType.DELETE, auditType = AuditType.SYS)
+    @OperateLog(title = "登录日志", businessType = BusinessType.DELETE, auditType = AuditType.SYS,operdesc = "删除登录日志")
     @PreAuthorize("@ss.hasPermi('auditManager:logininfor:remove')")
     @PreAuthorize("@ss.hasPermi('auditManager:logininfor:remove')")
     public ResponseVO delLoginInfo(String infoId) throws CustomException {
     public ResponseVO delLoginInfo(String infoId) throws CustomException {
         try {
         try {
@@ -149,7 +150,7 @@ public class SysLogininforController {
      * 清空登录信息
      * 清空登录信息
      */
      */
     @PostMapping("/cleanLogininfor")
     @PostMapping("/cleanLogininfor")
-    @OperateLog(title = "登录日志", businessType = BusinessType.CLEAN, auditType = AuditType.SYS)
+    @OperateLog(title = "登录日志", businessType = BusinessType.CLEAN, auditType = AuditType.SYS,operdesc = "清空登录日志")
     @PreAuthorize("@ss.hasPermi('auditManager:logininfor:remove')")
     @PreAuthorize("@ss.hasPermi('auditManager:logininfor:remove')")
     public ResponseVO cleanLogininfor() throws CustomException {
     public ResponseVO cleanLogininfor() throws CustomException {
         try {
         try {
@@ -172,6 +173,7 @@ public class SysLogininforController {
      */
      */
     @GetMapping(value = "/logininforTotal")
     @GetMapping(value = "/logininforTotal")
     @PreAuthorize("@ss.hasPermi('auditManager:logininforTotal:list')")
     @PreAuthorize("@ss.hasPermi('auditManager:logininforTotal:list')")
+    @OperateLog(title = "登录日志", businessType = BusinessType.QUERY, auditType = AuditType.SYS,operdesc = "查询统计登录日志")
     @PreventReplay
     @PreventReplay
     public ResponseVO logininforTotal(String startLoginTime, String endLoginTime) throws CustomException {
     public ResponseVO logininforTotal(String startLoginTime, String endLoginTime) throws CustomException {
         try {
         try {

+ 6 - 3
backend/src/main/java/com/jiayue/ssi/controller/SysMenuController.java

@@ -45,6 +45,7 @@ public class SysMenuController {
      */
      */
     @GetMapping("/list")
     @GetMapping("/list")
     @PreAuthorize("@ss.hasPermi('system:menu:list')")
     @PreAuthorize("@ss.hasPermi('system:menu:list')")
+    @OperateLog(title = "菜单管理", businessType = BusinessType.QUERY, auditType = AuditType.SYS,operdesc = "查询菜单")
     @PreventReplay
     @PreventReplay
     public ResponseVO list(SysMenu menu) throws CustomException {
     public ResponseVO list(SysMenu menu) throws CustomException {
         try {
         try {
@@ -64,7 +65,7 @@ public class SysMenuController {
      * 新增菜单
      * 新增菜单
      */
      */
     @PostMapping(value = "/addMenu")
     @PostMapping(value = "/addMenu")
-    @OperateLog(title = "菜单管理", businessType = BusinessType.INSERT, auditType = AuditType.SYS)
+    @OperateLog(title = "菜单管理", businessType = BusinessType.INSERT, auditType = AuditType.SYS,operdesc = "新增菜单")
     @PreAuthorize("@ss.hasPermi('system:menu:add')")
     @PreAuthorize("@ss.hasPermi('system:menu:add')")
     @PreventReplay
     @PreventReplay
     public ResponseVO addMenu(@RequestBody SysMenu menu) throws CustomException {
     public ResponseVO addMenu(@RequestBody SysMenu menu) throws CustomException {
@@ -137,7 +138,7 @@ public class SysMenuController {
      * @return 执行结果
      * @return 执行结果
      */
      */
     @PostMapping(value = "/updateMenu")
     @PostMapping(value = "/updateMenu")
-    @OperateLog(title = "菜单管理", businessType = BusinessType.UPDATE, auditType = AuditType.SYS)
+    @OperateLog(title = "菜单管理", businessType = BusinessType.UPDATE, auditType = AuditType.SYS,operdesc = "修改菜单")
     @PreAuthorize("@ss.hasPermi('system:menu:edit')")
     @PreAuthorize("@ss.hasPermi('system:menu:edit')")
     @PreventReplay
     @PreventReplay
     public ResponseVO updateMenu(@RequestBody SysMenu menu) throws CustomException {
     public ResponseVO updateMenu(@RequestBody SysMenu menu) throws CustomException {
@@ -211,6 +212,7 @@ public class SysMenuController {
      * 根据菜单编号获取详细信息
      * 根据菜单编号获取详细信息
      */
      */
     @GetMapping(value = "/{getDetailInfo}")
     @GetMapping(value = "/{getDetailInfo}")
+    @OperateLog(title = "菜单管理", businessType = BusinessType.QUERY, auditType = AuditType.SYS,operdesc = "获取菜单详细信息")
     @PreventReplay
     @PreventReplay
     public ResponseVO getDetailInfo(String menuId) throws CustomException {
     public ResponseVO getDetailInfo(String menuId) throws CustomException {
         try {
         try {
@@ -237,7 +239,7 @@ public class SysMenuController {
      * 删除菜单信息
      * 删除菜单信息
      */
      */
     @PostMapping(value = "delMenu")
     @PostMapping(value = "delMenu")
-    @OperateLog(title = "菜单管理", businessType = BusinessType.DELETE, auditType = AuditType.SYS)
+    @OperateLog(title = "菜单管理", businessType = BusinessType.DELETE, auditType = AuditType.SYS,operdesc = "删除菜单")
     @PreAuthorize("@ss.hasPermi('system:menu:remove')")
     @PreAuthorize("@ss.hasPermi('system:menu:remove')")
     @PreventReplay
     @PreventReplay
     public ResponseVO delMenu(String menuId) throws CustomException {
     public ResponseVO delMenu(String menuId) throws CustomException {
@@ -285,6 +287,7 @@ public class SysMenuController {
      * 加载对应角色菜单列表树
      * 加载对应角色菜单列表树
      */
      */
     @GetMapping(value = "/roleMenuTreeselect")
     @GetMapping(value = "/roleMenuTreeselect")
+    @OperateLog(title = "菜单管理", businessType = BusinessType.QUERY, auditType = AuditType.SYS,operdesc = "获取角色菜单列表")
     @PreventReplay
     @PreventReplay
     public ResponseVO roleMenuTreeselect(String roleId) throws CustomException {
     public ResponseVO roleMenuTreeselect(String roleId) throws CustomException {
         try {
         try {

+ 4 - 2
backend/src/main/java/com/jiayue/ssi/controller/SysOperlogController.java

@@ -79,6 +79,7 @@ public class SysOperlogController {
      */
      */
     @GetMapping(value = "/getAll")
     @GetMapping(value = "/getAll")
     @PreAuthorize("@ss.hasPermi('auditManager:operlog:list')")
     @PreAuthorize("@ss.hasPermi('auditManager:operlog:list')")
+    @OperateLog(title = "操作日志", businessType = BusinessType.QUERY, auditType = AuditType.SYS,operdesc = "查询操作日志")
     @PreventReplay
     @PreventReplay
     public ResponseVO getAll(String currentPage, String pageSize, String title, String operName, String auditType,
     public ResponseVO getAll(String currentPage, String pageSize, String title, String operName, String auditType,
                              String businessType, String status, String startOperTime, String endOperTime, String sortOrder) throws CustomException {
                              String businessType, String status, String startOperTime, String endOperTime, String sortOrder) throws CustomException {
@@ -174,7 +175,7 @@ public class SysOperlogController {
      * 删除登录信息
      * 删除登录信息
      */
      */
     @PostMapping(value = "/delOperlog")
     @PostMapping(value = "/delOperlog")
-    @OperateLog(title = "操作日志", businessType = BusinessType.DELETE, auditType = AuditType.SYS)
+    @OperateLog(title = "操作日志", businessType = BusinessType.DELETE, auditType = AuditType.SYS,operdesc = "删除操作日志")
     @PreAuthorize("@ss.hasPermi('auditManager:operlog:remove')")
     @PreAuthorize("@ss.hasPermi('auditManager:operlog:remove')")
     public ResponseVO delOperlog(String operId) throws CustomException {
     public ResponseVO delOperlog(String operId) throws CustomException {
         try {
         try {
@@ -197,7 +198,7 @@ public class SysOperlogController {
      * 操作日志清空
      * 操作日志清空
      */
      */
     @PostMapping("/cleanOperLog")
     @PostMapping("/cleanOperLog")
-    @OperateLog(title = "操作日志", businessType = BusinessType.CLEAN, auditType = AuditType.SYS)
+    @OperateLog(title = "操作日志", businessType = BusinessType.CLEAN, auditType = AuditType.SYS,operdesc = "清空操作日志")
     @PreAuthorize("@ss.hasPermi('auditManager:operlog:remove')")
     @PreAuthorize("@ss.hasPermi('auditManager:operlog:remove')")
     public ResponseVO cleanOperLog() throws CustomException {
     public ResponseVO cleanOperLog() throws CustomException {
         try {
         try {
@@ -220,6 +221,7 @@ public class SysOperlogController {
      */
      */
     @GetMapping(value = "/sysOperlogTotal")
     @GetMapping(value = "/sysOperlogTotal")
     @PreAuthorize("@ss.hasPermi('auditManager:sysOperlogTotal:list')")
     @PreAuthorize("@ss.hasPermi('auditManager:sysOperlogTotal:list')")
+    @OperateLog(title = "操作日志", businessType = BusinessType.QUERY, auditType = AuditType.SYS,operdesc = "查询统计操作日志")
     @PreventReplay
     @PreventReplay
     public ResponseVO sysOperlogTotal(String startLoginTime, String endLoginTime) throws CustomException {
     public ResponseVO sysOperlogTotal(String startLoginTime, String endLoginTime) throws CustomException {
         try {
         try {

+ 4 - 3
backend/src/main/java/com/jiayue/ssi/controller/SysParameterController.java

@@ -40,7 +40,7 @@ public class SysParameterController {
      * @return 执行结果
      * @return 执行结果
      */
      */
     @PostMapping(value = "/addParameter")
     @PostMapping(value = "/addParameter")
-    @OperateLog(title = "参数管理", businessType = BusinessType.INSERT, auditType = AuditType.SYS)
+    @OperateLog(title = "参数管理", businessType = BusinessType.INSERT, auditType = AuditType.SYS,operdesc = "新增参数信息")
     @PreAuthorize("@ss.hasPermi('system:config:add')")
     @PreAuthorize("@ss.hasPermi('system:config:add')")
     @PreventReplay
     @PreventReplay
     public ResponseVO addParameter(@RequestBody SysParameter sysParameter) throws CustomException {
     public ResponseVO addParameter(@RequestBody SysParameter sysParameter) throws CustomException {
@@ -92,7 +92,7 @@ public class SysParameterController {
      * @return 执行结果
      * @return 执行结果
      */
      */
     @PostMapping(value = "/updateParameter")
     @PostMapping(value = "/updateParameter")
-    @OperateLog(title = "参数管理", businessType = BusinessType.UPDATE, auditType = AuditType.SYS)
+    @OperateLog(title = "参数管理", businessType = BusinessType.UPDATE, auditType = AuditType.SYS,operdesc = "修改参数信息")
     @PreAuthorize("@ss.hasPermi('system:config:edit')")
     @PreAuthorize("@ss.hasPermi('system:config:edit')")
     @PreventReplay
     @PreventReplay
     public ResponseVO updateParameter(@RequestBody SysParameter sysParameter) throws CustomException {
     public ResponseVO updateParameter(@RequestBody SysParameter sysParameter) throws CustomException {
@@ -148,7 +148,7 @@ public class SysParameterController {
      * 删除用户信息
      * 删除用户信息
      */
      */
     @PostMapping(value = "/deleteParameter")
     @PostMapping(value = "/deleteParameter")
-    @OperateLog(title = "参数管理", businessType = BusinessType.DELETE, auditType = AuditType.SYS)
+    @OperateLog(title = "参数管理", businessType = BusinessType.DELETE, auditType = AuditType.SYS,operdesc = "删除参数信息")
     @PreAuthorize("@ss.hasPermi('system:config:remove')")
     @PreAuthorize("@ss.hasPermi('system:config:remove')")
     @PreventReplay
     @PreventReplay
     public ResponseVO deleteParameter(String id) throws CustomException {
     public ResponseVO deleteParameter(String id) throws CustomException {
@@ -179,6 +179,7 @@ public class SysParameterController {
      */
      */
     @GetMapping(value = "/getAll")
     @GetMapping(value = "/getAll")
     @PreAuthorize("@ss.hasPermi('system:config:list')")
     @PreAuthorize("@ss.hasPermi('system:config:list')")
+    @OperateLog(title = "参数管理", businessType = BusinessType.QUERY, auditType = AuditType.SYS,operdesc = "查询参数信息")
     @PreventReplay
     @PreventReplay
     public ResponseVO getAll(String currentPage, String pageSize, String keywords) throws CustomException {
     public ResponseVO getAll(String currentPage, String pageSize, String keywords) throws CustomException {
         try {
         try {

+ 2 - 1
backend/src/main/java/com/jiayue/ssi/controller/SysPolicyController.java

@@ -41,6 +41,7 @@ public class SysPolicyController {
      */
      */
     @GetMapping(value = "/getAll")
     @GetMapping(value = "/getAll")
     @PreAuthorize("@ss.hasPermi('system:policy:getAll')")
     @PreAuthorize("@ss.hasPermi('system:policy:getAll')")
+    @OperateLog(title = "策略配置", businessType = BusinessType.QUERY, auditType = AuditType.SYS,operdesc = "获取策略配置信息")
     @PreventReplay
     @PreventReplay
     public ResponseVO getAll() throws CustomException {
     public ResponseVO getAll() throws CustomException {
         try {
         try {
@@ -55,7 +56,7 @@ public class SysPolicyController {
      * 保存策略配置
      * 保存策略配置
      */
      */
     @PostMapping
     @PostMapping
-    @OperateLog(title = "策略配置", businessType = BusinessType.UPDATE, auditType = AuditType.SYS)
+    @OperateLog(title = "策略配置", businessType = BusinessType.UPDATE, auditType = AuditType.SYS,operdesc = "保存策略配置信息")
     @PreAuthorize("@ss.hasPermi('system:policy:update')")
     @PreAuthorize("@ss.hasPermi('system:policy:update')")
     @PreventReplay
     @PreventReplay
     public ResponseVO update(@RequestBody SysPolicy sysPolicy) throws CustomException {
     public ResponseVO update(@RequestBody SysPolicy sysPolicy) throws CustomException {

+ 6 - 3
backend/src/main/java/com/jiayue/ssi/controller/SysRoleController.java

@@ -45,6 +45,7 @@ public class SysRoleController {
      */
      */
     @GetMapping(value = "/getAll")
     @GetMapping(value = "/getAll")
     @PreAuthorize("@ss.hasPermi('system:role:list')")
     @PreAuthorize("@ss.hasPermi('system:role:list')")
+    @OperateLog(title = "角色管理", businessType = BusinessType.QUERY, auditType = AuditType.SYS,operdesc = "角色查询")
     @PreventReplay
     @PreventReplay
     public ResponseVO getAll(String currentPage, String pageSize, String roleName, String status, String roleKey) throws CustomException {
     public ResponseVO getAll(String currentPage, String pageSize, String roleName, String status, String roleKey) throws CustomException {
         try {
         try {
@@ -116,7 +117,7 @@ public class SysRoleController {
      * @return 执行结果
      * @return 执行结果
      */
      */
     @PostMapping(value = "/addRole")
     @PostMapping(value = "/addRole")
-    @OperateLog(title = "角色管理", businessType = BusinessType.INSERT, auditType = AuditType.SYS)
+    @OperateLog(title = "角色管理", businessType = BusinessType.INSERT, auditType = AuditType.SYS,operdesc = "新增角色")
     @PreAuthorize("@ss.hasPermi('system:role:add')")
     @PreAuthorize("@ss.hasPermi('system:role:add')")
     @PreventReplay
     @PreventReplay
     public ResponseVO addRole(@RequestBody SysRole role) throws CustomException {
     public ResponseVO addRole(@RequestBody SysRole role) throws CustomException {
@@ -169,7 +170,7 @@ public class SysRoleController {
      * @return 执行结果
      * @return 执行结果
      */
      */
     @PostMapping(value = "/updateRole")
     @PostMapping(value = "/updateRole")
-    @OperateLog(title = "角色管理", businessType = BusinessType.UPDATE, auditType = AuditType.SYS)
+    @OperateLog(title = "角色管理", businessType = BusinessType.UPDATE, auditType = AuditType.SYS,operdesc = "修改角色")
     @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @PreventReplay
     @PreventReplay
     public ResponseVO updateRole(@RequestBody SysRole role) throws CustomException {
     public ResponseVO updateRole(@RequestBody SysRole role) throws CustomException {
@@ -231,6 +232,7 @@ public class SysRoleController {
      * 根据角色编号获取详细信息
      * 根据角色编号获取详细信息
      */
      */
     @GetMapping(value = "getInfo")
     @GetMapping(value = "getInfo")
+    @OperateLog(title = "角色管理", businessType = BusinessType.QUERY, auditType = AuditType.SYS,operdesc = "获取角色详细信息")
     @PreventReplay
     @PreventReplay
     public ResponseVO getInfo(String roleId) throws CustomException {
     public ResponseVO getInfo(String roleId) throws CustomException {
         try {
         try {
@@ -257,7 +259,7 @@ public class SysRoleController {
      * 删除角色
      * 删除角色
      */
      */
     @PostMapping(value = "/delRole")
     @PostMapping(value = "/delRole")
-    @OperateLog(title = "角色管理", businessType = BusinessType.DELETE, auditType = AuditType.SYS)
+    @OperateLog(title = "角色管理", businessType = BusinessType.DELETE, auditType = AuditType.SYS,operdesc = "删除角色")
     @PreAuthorize("@ss.hasPermi('system:role:remove')")
     @PreAuthorize("@ss.hasPermi('system:role:remove')")
     @PreventReplay
     @PreventReplay
     public ResponseVO delRole(String roleId) throws CustomException {
     public ResponseVO delRole(String roleId) throws CustomException {
@@ -295,6 +297,7 @@ public class SysRoleController {
      */
      */
     @GetMapping(value = "/getRoleByType")
     @GetMapping(value = "/getRoleByType")
     @PreAuthorize("@ss.hasPermi('system:user:role')")
     @PreAuthorize("@ss.hasPermi('system:user:role')")
+    @OperateLog(title = "角色管理", businessType = BusinessType.QUERY, auditType = AuditType.SYS,operdesc = "获取分配角色列表")
     @PreventReplay
     @PreventReplay
     public ResponseVO getRoleByType(String usertype) throws CustomException {
     public ResponseVO getRoleByType(String usertype) throws CustomException {
         try {
         try {

+ 11 - 8
backend/src/main/java/com/jiayue/ssi/controller/SysUserController.java

@@ -64,6 +64,7 @@ public class SysUserController {
      */
      */
     @GetMapping(value = "/getAll")
     @GetMapping(value = "/getAll")
     @PreAuthorize("@ss.hasPermi('system:user:list')")
     @PreAuthorize("@ss.hasPermi('system:user:list')")
+    @OperateLog(title = "用户管理", businessType = BusinessType.QUERY, auditType = AuditType.SYS,operdesc = "用户查询")
     @PreventReplay
     @PreventReplay
     public ResponseVO getAll(String username, String phonenumber,
     public ResponseVO getAll(String username, String phonenumber,
                              String status) throws CustomException {
                              String status) throws CustomException {
@@ -132,7 +133,7 @@ public class SysUserController {
      * 新增用户
      * 新增用户
      */
      */
     @PostMapping(value = "/addUser")
     @PostMapping(value = "/addUser")
-    @OperateLog(title = "用户管理", businessType = BusinessType.INSERT, auditType = AuditType.SYS)
+    @OperateLog(title = "用户管理", businessType = BusinessType.INSERT, auditType = AuditType.SYS,operdesc = "新增用户")
     @PreAuthorize("@ss.hasPermi('system:user:add')")
     @PreAuthorize("@ss.hasPermi('system:user:add')")
     @PreventReplay
     @PreventReplay
     public ResponseVO addUser(@RequestBody SysUser user) throws CustomException {
     public ResponseVO addUser(@RequestBody SysUser user) throws CustomException {
@@ -260,7 +261,7 @@ public class SysUserController {
      */
      */
     @PostMapping(value = "/updateUser")
     @PostMapping(value = "/updateUser")
     @AgainVerify
     @AgainVerify
-    @OperateLog(title = "用户管理", businessType = BusinessType.UPDATE, auditType = AuditType.SYS)
+    @OperateLog(title = "用户管理", businessType = BusinessType.UPDATE, auditType = AuditType.SYS,operdesc = "修改用户")
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @PreventReplay
     @PreventReplay
     public ResponseVO updateUser(@RequestBody SysUser user) throws CustomException {
     public ResponseVO updateUser(@RequestBody SysUser user) throws CustomException {
@@ -377,7 +378,7 @@ public class SysUserController {
      * 初始密码发送邮箱
      * 初始密码发送邮箱
      */
      */
     @PostMapping(value = "/resetPassword")
     @PostMapping(value = "/resetPassword")
-    @OperateLog(title = "用户管理", businessType = BusinessType.OTHER, auditType = AuditType.SYS)
+    @OperateLog(title = "用户管理", businessType = BusinessType.RESETPWD, auditType = AuditType.SYS,operdesc = "初始/重置密码发送邮箱")
     @PreAuthorize("@ss.hasPermi('system:user:send')")
     @PreAuthorize("@ss.hasPermi('system:user:send')")
     @PreventReplay
     @PreventReplay
     public ResponseVO resetPassword(String id) {
     public ResponseVO resetPassword(String id) {
@@ -430,7 +431,7 @@ public class SysUserController {
      */
      */
     @PostMapping(value = "/delUser")
     @PostMapping(value = "/delUser")
     @AgainVerify
     @AgainVerify
-    @OperateLog(title = "用户管理", businessType = BusinessType.DELETE, auditType = AuditType.SYS)
+    @OperateLog(title = "用户管理", businessType = BusinessType.DELETE, auditType = AuditType.SYS,operdesc = "删除用户")
     @PreAuthorize("@ss.hasPermi('system:user:remove')")
     @PreAuthorize("@ss.hasPermi('system:user:remove')")
     @PreventReplay
     @PreventReplay
     public ResponseVO delete(String id) throws CustomException {
     public ResponseVO delete(String id) throws CustomException {
@@ -473,7 +474,7 @@ public class SysUserController {
      * 修改密码
      * 修改密码
      */
      */
     @PostMapping(value = "/updatePassword")
     @PostMapping(value = "/updatePassword")
-    @OperateLog(title = "用户管理", businessType = BusinessType.UPDATE, auditType = AuditType.SYS)
+    @OperateLog(title = "用户管理", businessType = BusinessType.PWDUPDATE, auditType = AuditType.SYS,operdesc = "修改个人密码")
     @PreventReplay
     @PreventReplay
     public ResponseVO updatePassword(String id, String oldPassword, String newPassword, String confirmPassword) throws CustomException {
     public ResponseVO updatePassword(String id, String oldPassword, String newPassword, String confirmPassword) throws CustomException {
         try {
         try {
@@ -557,7 +558,7 @@ public class SysUserController {
      * 解锁用户信息
      * 解锁用户信息
      */
      */
     @PostMapping(value = "/relockUser")
     @PostMapping(value = "/relockUser")
-    @OperateLog(title = "用户管理", businessType = BusinessType.OTHER, auditType = AuditType.SYS)
+    @OperateLog(title = "用户管理", businessType = BusinessType.UNLOCK, auditType = AuditType.SYS,operdesc = "用户账号解锁")
     @PreAuthorize("@ss.hasPermi('system:user:relock')")
     @PreAuthorize("@ss.hasPermi('system:user:relock')")
     @PreventReplay
     @PreventReplay
     public ResponseVO relockUser(String id) throws CustomException {
     public ResponseVO relockUser(String id) throws CustomException {
@@ -603,7 +604,7 @@ public class SysUserController {
      */
      */
     @PostMapping("/authRole")
     @PostMapping("/authRole")
     @PreAuthorize("@ss.hasPermi('system:user:role')")
     @PreAuthorize("@ss.hasPermi('system:user:role')")
-    @OperateLog(title = "用户管理", businessType = BusinessType.GRANT, auditType = AuditType.SYS)
+    @OperateLog(title = "用户管理", businessType = BusinessType.GRANT, auditType = AuditType.SYS,operdesc = "用户授权角色")
     @PreventReplay
     @PreventReplay
     public ResponseVO authRole(String userId, String roleId) throws CustomException {
     public ResponseVO authRole(String userId, String roleId) throws CustomException {
         try {
         try {
@@ -667,6 +668,7 @@ public class SysUserController {
      * @return
      * @return
      */
      */
     @GetMapping("/getUserRole")
     @GetMapping("/getUserRole")
+    @OperateLog(title = "用户管理", businessType = BusinessType.GETROLE, auditType = AuditType.SYS,operdesc = "获取授权角色信息")
     @PreventReplay
     @PreventReplay
     public ResponseVO getUserRole(Long userId) throws CustomException {
     public ResponseVO getUserRole(Long userId) throws CustomException {
         try {
         try {
@@ -705,7 +707,7 @@ public class SysUserController {
      */
      */
     @PostMapping(value = "/logOffUser")
     @PostMapping(value = "/logOffUser")
     @AgainVerify
     @AgainVerify
-    @OperateLog(title = "用户管理", businessType = BusinessType.DELETE, auditType = AuditType.SYS)
+    @OperateLog(title = "用户管理", businessType = BusinessType.DELETE, auditType = AuditType.SYS,operdesc = "注销用户账号")
     @PreAuthorize("@ss.hasPermi('system:user:logoff')")
     @PreAuthorize("@ss.hasPermi('system:user:logoff')")
     @PreventReplay
     @PreventReplay
     public ResponseVO logOffUser(String id) throws CustomException {
     public ResponseVO logOffUser(String id) throws CustomException {
@@ -767,6 +769,7 @@ public class SysUserController {
      */
      */
     @GetMapping(value = "/getUserByHealthy")
     @GetMapping(value = "/getUserByHealthy")
     @PreAuthorize("@ss.hasPermi('monitor:onLine:list')")
     @PreAuthorize("@ss.hasPermi('monitor:onLine:list')")
+    @OperateLog(title = "在线用户管理", businessType = BusinessType.QUERY, auditType = AuditType.SYS,operdesc = "在线用户查询")
     @PreventReplay
     @PreventReplay
     public ResponseVO getUserByHealthy(String currentPage, String pageSize, String onLineStatus) throws CustomException {
     public ResponseVO getUserByHealthy(String currentPage, String pageSize, String onLineStatus) throws CustomException {
         try {
         try {

+ 3 - 0
backend/src/main/java/com/jiayue/ssi/controller/UserLoginController.java

@@ -1,6 +1,9 @@
 package com.jiayue.ssi.controller;
 package com.jiayue.ssi.controller;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.jiayue.ssi.annotation.OperateLog;
+import com.jiayue.ssi.backenum.AuditType;
+import com.jiayue.ssi.backenum.BusinessType;
 import com.jiayue.ssi.config.SendMailUtil;
 import com.jiayue.ssi.config.SendMailUtil;
 import com.jiayue.ssi.constant.CacheConstants;
 import com.jiayue.ssi.constant.CacheConstants;
 import com.jiayue.ssi.constant.CustomException;
 import com.jiayue.ssi.constant.CustomException;

+ 11 - 0
backend/src/main/java/com/jiayue/ssi/entity/SysOperLog.java

@@ -32,6 +32,17 @@ public class SysOperLog extends BaseEntity {
     @TableField(exist = false)
     @TableField(exist = false)
     private Integer[] businessTypes;
     private Integer[] businessTypes;
 
 
+    public String getOperdesc() {
+        return operdesc;
+    }
+
+    public void setOperdesc(String operdesc) {
+        this.operdesc = operdesc;
+    }
+
+    /** 操作描述 */
+    private String operdesc;
+
     /** 请求方法 */
     /** 请求方法 */
     private String method;
     private String method;
 
 

+ 1 - 1
backend/src/main/java/com/jiayue/ssi/filter/MailCodeFilter.java

@@ -85,11 +85,11 @@ public class MailCodeFilter extends OncePerRequestFilter {
                     }
                     }
                 }
                 }
             }
             }
-            filterChain.doFilter(request, response);
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
             ResponseInfo.doResponse(response, "邮箱口令错误!", 401);
             ResponseInfo.doResponse(response, "邮箱口令错误!", 401);
             return;
             return;
         }
         }
+        filterChain.doFilter(request, response);
     }
     }
 }
 }

+ 2 - 1
backend/src/main/java/com/jiayue/ssi/filter/VerifyCodeFilter.java

@@ -73,10 +73,11 @@ public class VerifyCodeFilter extends OncePerRequestFilter {
                     return;
                     return;
                 }
                 }
             }
             }
-            filterChain.doFilter(request, response);
+
         } catch (Exception e) {
         } catch (Exception e) {
             ResponseInfo.doResponse(response, "验证码错误!", 401);
             ResponseInfo.doResponse(response, "验证码错误!", 401);
             return;
             return;
         }
         }
+        filterChain.doFilter(request, response);
     }
     }
 }
 }

+ 1 - 1
backend/src/main/java/com/jiayue/ssi/filter/VerifySmFilter.java

@@ -189,7 +189,7 @@ public class VerifySmFilter extends OncePerRequestFilter {
             ParameterRequestWrapper pr = new ParameterRequestWrapper(initWrapper, stringToMap, decryptStr);
             ParameterRequestWrapper pr = new ParameterRequestWrapper(initWrapper, stringToMap, decryptStr);
             filterChain.doFilter(pr, response);
             filterChain.doFilter(pr, response);
         } catch (Exception e) {
         } catch (Exception e) {
-            log.error(IPUtils.getIpAddr(request) + "访问系统失败", e);
+//            log.error(IPUtils.getIpAddr(request) + "访问系统失败", e);
             ResponseInfo.doResponse(response, "访问失败,联系管理员!", 401);
             ResponseInfo.doResponse(response, "访问失败,联系管理员!", 401);
             return;
             return;
         }
         }

+ 14 - 8
backend/src/test/java/com/jiayue/ssi/service/Sm2UiTest.java

@@ -1,5 +1,6 @@
 package com.jiayue.ssi.service;
 package com.jiayue.ssi.service;
 
 
+import cn.hutool.crypto.SmUtil;
 import com.jiayue.ssi.constant.SecretKeyConstants;
 import com.jiayue.ssi.constant.SecretKeyConstants;
 import com.jiayue.ssi.util.SM2CryptUtils;
 import com.jiayue.ssi.util.SM2CryptUtils;
 
 
@@ -23,17 +24,22 @@ public class Sm2UiTest {
 
 
 
 
 
 
-        String jiami = SM2CryptUtils.encrypt("root","041967638ca43d4577d8dba166bff4437fde944270101f398a95b846ec2f8177d09f8abc5d62b6cd2c7216274d7abe0c8e04b0bb691207a32dd2e12d6bd2798672");
-        System.out.println("加密:"+jiami);
-        String jiemi = SM2CryptUtils.decrypt(jiami,"6155d63ee27cbeca07f3e40c4f8856f1be8119fcbda1aadc7e0e595e52bad7bd");
-        System.out.println("解密:"+jiemi);
+//        String jiami = SM2CryptUtils.encrypt("root","041967638ca43d4577d8dba166bff4437fde944270101f398a95b846ec2f8177d09f8abc5d62b6cd2c7216274d7abe0c8e04b0bb691207a32dd2e12d6bd2798672");
+//        System.out.println("加密:"+jiami);
+//        String jiemi = SM2CryptUtils.decrypt(jiami,"6155d63ee27cbeca07f3e40c4f8856f1be8119fcbda1aadc7e0e595e52bad7bd");
+//        System.out.println("解密:"+jiemi);
+//
+//
+//        String qianming = SM2CryptUtils.sign("6155d63ee27cbeca07f3e40c4f8856f1be8119fcbda1aadc7e0e595e52bad7bd",jiemi);
+//        System.out.println("签名:"+qianming);
+//
+//        boolean yanqian = SM2CryptUtils.verifySign("041967638ca43d4577d8dba166bff4437fde944270101f398a95b846ec2f8177d09f8abc5d62b6cd2c7216274d7abe0c8e04b0bb691207a32dd2e12d6bd2798672",jiemi,qianming);
+//        System.out.println("验签:"+yanqian);
 
 
 
 
-        String qianming = SM2CryptUtils.sign("6155d63ee27cbeca07f3e40c4f8856f1be8119fcbda1aadc7e0e595e52bad7bd",jiemi);
-        System.out.println("签名:"+qianming);
+        String a= SmUtil.sm3("Xsl147258").toUpperCase();
+        System.out.println(SM2CryptUtils.encrypt(a,SecretKeyConstants.SERVER_PUBLIC_KEY));
 
 
-        boolean yanqian = SM2CryptUtils.verifySign("041967638ca43d4577d8dba166bff4437fde944270101f398a95b846ec2f8177d09f8abc5d62b6cd2c7216274d7abe0c8e04b0bb691207a32dd2e12d6bd2798672",jiemi,qianming);
-        System.out.println("验签:"+yanqian);
 
 
     }
     }
 }
 }

+ 50 - 53
ui/src/App.vue

@@ -16,59 +16,56 @@ export default {
       return false;
       return false;
     };
     };
 
 
-    // window.addEventListener("beforeunload", e => {
-    //   this.beforeunloadHandler(e)
-    //   let userAgent = navigator.userAgent
-    //   let isOpera = userAgent.indexOf("Opera") > -1;
-    //   if (isOpera) { //判断是否Opera浏览器
-    //     return "Opera"
-    //   }
-    //   if (userAgent.indexOf("Firefox") > -1) {
-    //     this.unloadHandler();
-    //   }
-    //   if (userAgent.indexOf("MSIE") > -1) {
-    //     this.unloadHandler();
-    //   }
-    // });
-    // window.addEventListener("unload", async e => {
-    //   this.unloadHandler(e)
-    // });
+    window.addEventListener("beforeunload", e => {
+      this.beforeunloadHandler(e)
+      let userAgent = navigator.userAgent
+      let isOpera = userAgent.indexOf("Opera") > -1;
+      if (isOpera) { //判断是否Opera浏览器
+        return "Opera"
+      }
+      if (userAgent.indexOf("Firefox") > -1) {
+        this.unloadHandler();
+      }
+      if (userAgent.indexOf("MSIE") > -1) {
+        this.unloadHandler();
+      }
+    });
+    window.addEventListener("unload", async e => {
+      this.unloadHandler(e)
+    });
   },
   },
-  // methods: {
-  //   beforeunloadHandler(e) {
-  //     this._beforeUnload_time = new Date().getTime();
-  //   },
-  //   unloadHandler(e) {
-  //     this._gap_time = new Date().getTime() - this._beforeUnload_time;
-  //
-  //     //判断是窗口关闭还是刷新
-  //     localStorage.setItem('time', this._gap_time)
-  //     console.log(this._gap_time, 333333)
-  //     if (this._gap_time <= 5) {
-  //       console.log(this._gap_time, 333333)
-  //       // // 发送设置同步 (退出登陆的api)
-  //       // this.$store.dispatch('LogOut').then(() => {
-  //       //   location.href = '/index';
-  //       // })
-  //
-  //
-  //       this.$axios.post(
-  //         '/logout', {}
-  //       ).then((res) => {
-  //         this.$message.success(res.data)
-  //         removeToken()
-  //         //注销返回自己的登录页
-  //         this.$router.push(`/login?redirect=${this.$route.fullPath}`)
-  //       })
-  //     } else {
-  //     }
-  //   },
-  // },
-  // destroyed() {
-  //   window.removeEventListener("beforeunload", e =>
-  //     this.beforeunloadHandler(e)
-  //   );
-  //   window.removeEventListener("unload", e => this.unloadHandler(e));
-  // }
+  methods: {
+    beforeunloadHandler(e) {
+      this._beforeUnload_time = new Date().getTime();
+    },
+    unloadHandler(e) {
+      this._gap_time = new Date().getTime() - this._beforeUnload_time;
+      //判断是窗口关闭还是刷新
+      localStorage.setItem('time', this._gap_time)
+      if (this._gap_time <= 5) {
+        // // 发送设置同步 (退出登陆的api)
+        // this.$store.dispatch('LogOut').then(() => {
+        //   location.href = '/index';
+        // })
+
+
+        this.$axios.post(
+          '/logout', {}
+        ).then((res) => {
+          this.$message.success(res.data)
+          removeToken()
+          //注销返回自己的登录页
+          this.$router.push(`/login?redirect=${this.$route.fullPath}`)
+        })
+      } else {
+      }
+    },
+  },
+  destroyed() {
+    window.removeEventListener("beforeunload", e =>
+      this.beforeunloadHandler(e)
+    );
+    window.removeEventListener("unload", e => this.unloadHandler(e));
+  }
 }
 }
 </script>
 </script>