【程序目录】缓存优化

This commit is contained in:
evoxwht 2023-12-23 11:13:12 +08:00
parent 20352cc696
commit 9e5d67f77e
3 changed files with 16 additions and 3 deletions

View File

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

View File

@ -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();
}
}

View File

@ -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