From 2d2d9138fbe5c9c43f070be59a2d10f18fbf4c3b Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期三, 23 十一月 2022 09:05:06 +0800
Subject: [PATCH] 1

---
 src/main/java/com/lf/server/controller/sys/AuthController.java |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/lf/server/controller/sys/AuthController.java b/src/main/java/com/lf/server/controller/sys/AuthController.java
index 425ebeb..342ef6a 100644
--- a/src/main/java/com/lf/server/controller/sys/AuthController.java
+++ b/src/main/java/com/lf/server/controller/sys/AuthController.java
@@ -1,10 +1,11 @@
 package com.lf.server.controller.sys;
 
-import com.lf.server.aspect.SysLog;
+import com.lf.server.annotation.SysLog;
 import com.lf.server.controller.all.BaseController;
 import com.lf.server.entity.all.ResponseMsg;
 import com.lf.server.entity.sys.AuthEntity;
 import com.lf.server.entity.sys.UserEntity;
+import com.lf.server.service.all.PermsService;
 import com.lf.server.service.sys.AuthService;
 import com.lf.server.service.sys.TokenService;
 import io.swagger.annotations.Api;
@@ -31,6 +32,9 @@
 
     @Autowired
     TokenService tokenService;
+
+    @Autowired
+    PermsService permsService;
 
     @SysLog()
     @ApiOperation(value = "鏌ヨ璁板綍鏁�")
@@ -136,6 +140,9 @@
             }
 
             int count = authService.insertAuth(entity);
+            if (count > 0) {
+                permsService.clearPermsCache();
+            }
 
             return success(count);
         } catch (Exception ex) {
@@ -159,6 +166,9 @@
             }
 
             int count = authService.insertAuths(list);
+            if (count > 0) {
+                permsService.clearPermsCache();
+            }
 
             return success(count);
         } catch (Exception ex) {
@@ -175,6 +185,9 @@
     public ResponseMsg<Integer> deleteAuth(int id) {
         try {
             int count = authService.deleteAuth(id);
+            if (count > 0) {
+                permsService.clearPermsCache();
+            }
 
             return success(count);
         } catch (Exception ex) {
@@ -193,7 +206,12 @@
             if (ids == null || ids.isEmpty()) {
                 return fail("id鏁扮粍涓嶈兘涓虹┖", -1);
             }
+
             int count = authService.deleteAuths(ids);
+            if (count > 0) {
+                permsService.clearPermsCache();
+            }
+
             return success(count);
         } catch (Exception ex) {
             return fail(ex.getMessage(), -1);
@@ -215,6 +233,9 @@
             }
 
             int count = authService.updateAuth(entity);
+            if (count > 0) {
+                permsService.clearPermsCache();
+            }
 
             return success(count);
         } catch (Exception ex) {

--
Gitblit v1.9.3