lip 3 月之前
父節點
當前提交
c95abbc85e
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      app/admin/controller/IpConfig.php

+ 7 - 0
app/admin/controller/IpConfig.php

@@ -7,6 +7,7 @@ use app\admin\model\IpConfig as IpConfigModel;
 use app\admin\validate\IpConfigValidate;
 use app\admin\validate\IpConfigValidate;
 use Exception;
 use Exception;
 use think\facade\Db;
 use think\facade\Db;
+use think\facade\Cache;
 
 
 class IpConfig extends BaseController
 class IpConfig extends BaseController
 {
 {
@@ -27,6 +28,9 @@ class IpConfig extends BaseController
             Db::rollBack();
             Db::rollBack();
             return $this->error($e->getMessage());
             return $this->error($e->getMessage());
         }
         }
+        //删除缓存
+        Cache::delete('ip_blacklist');
+        Cache::delete('ip_whitelist');
         return $this->success();
         return $this->success();
     }
     }
 
 
@@ -60,6 +64,9 @@ class IpConfig extends BaseController
             Db::rollBack();
             Db::rollBack();
             return $this->error($e->getMessage());
             return $this->error($e->getMessage());
         }
         }
+        //删除缓存
+        Cache::delete('ip_blacklist');
+        Cache::delete('ip_whitelist');
         return $this->success();
         return $this->success();
     }
     }