From 4ddfd502023662f6d25c4be416d88751e206d91a Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期二, 25 十月 2022 09:45:30 +0800
Subject: [PATCH] 1

---
 src/main/java/com/lf/server/controller/sys/AuthController.java |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 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..c90be8b 100644
--- a/src/main/java/com/lf/server/controller/sys/AuthController.java
+++ b/src/main/java/com/lf/server/controller/sys/AuthController.java
@@ -5,6 +5,7 @@
 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