فهرست منبع

【程序目录】缓存优化

evoxwht 2 سال پیش
والد
کامیت
9e5d67f77e

+ 1 - 1
crmeb/app/adminapi/controller/v1/system/Clear.php

@@ -33,7 +33,7 @@ class Clear extends AuthController
      */
     public function refresh_cache()
     {
-        $this->services->refresCache();
+        $this->services->refreshCache();
         return app('json')->success(400302);
     }
 

+ 2 - 2
crmeb/app/services/system/log/ClearServices.php

@@ -51,7 +51,7 @@ class ClearServices extends BaseServices
     /**
      * 刷新数据缓存
      */
-    public function refresCache()
+    public function refreshCache()
     {
         $root = app()->getRootPath() . 'runtime' . DS;
         $adminRoute = $root . 'admin';
@@ -78,6 +78,6 @@ class ClearServices extends BaseServices
                 }
             }
         }
-        CacheService::clear();
+        CacheService::clearAll();
     }
 }

+ 13 - 0
crmeb/crmeb/services/CacheService.php

@@ -98,6 +98,19 @@ class CacheService
         return Cache::tag($tag)->clear();
     }
 
+    /**
+     * 清空全部缓存
+     * @return bool
+     * @author 吴汐
+     * @email 442384644@qq.com
+     * @date 2023/12/19
+     */
+    public static function clearAll()
+    {
+        return Cache::clear();
+    }
+
+
     /**
      * 检查缓存是否存在
      * @param string $key