diff --git a/themes/beauty/controller/SiteController.php b/themes/beauty/controller/SiteController.php index 4c2185f..967ad0b 100644 --- a/themes/beauty/controller/SiteController.php +++ b/themes/beauty/controller/SiteController.php @@ -283,6 +283,19 @@ Class SiteController extends Controller { unlink("{$cacheDir}{$file}"); } + + //删除图片缓存: image/ + $imgCacheDir = "{$cacheDir}image/"; + if (is_dir($imgCacheDir)) { + $files = scandir($imgCacheDir); + foreach($files as $file) { + if (!preg_match('/\.json$/i', $file)) {continue;} + + unlink("{$imgCacheDir}{$file}"); + } + + rmdir($imgCacheDir); + } } }catch(Exception $e) { $code = 0;