diff --git a/themes/beauty/controller/SiteController.php b/themes/beauty/controller/SiteController.php index c18bf07..601f245 100644 --- a/themes/beauty/controller/SiteController.php +++ b/themes/beauty/controller/SiteController.php @@ -231,12 +231,17 @@ Class SiteController extends Controller { $msg = 'OK'; try { - $cacheDir = __DIR__ . '/../../../runtime/cache/'; - $files = scandir($cacheDir); - foreach($files as $file) { - if (!preg_match('/\.json$/i', $file)) {continue;} + if (Common::isAdminIp($this->getUserIp()) == false) { + $code = 0; + $msg = '403 Forbidden,禁止访问'; + }else { + $cacheDir = __DIR__ . '/../../../runtime/cache/'; + $files = scandir($cacheDir); + foreach($files as $file) { + if (!preg_match('/\.json$/i', $file)) {continue;} - unlink("{$cacheDir}{$file}"); + unlink("{$cacheDir}{$file}"); + } } }catch(Exception $e) { $code = 0; diff --git a/themes/beauty/views/site/index.php b/themes/beauty/views/site/index.php index af28312..0fed848 100644 --- a/themes/beauty/views/site/index.php +++ b/themes/beauty/views/site/index.php @@ -21,7 +21,9 @@ $main_view_cls = $menu_ext_status == 'opened' ? '' : 'full';