diff --git a/app/admin/controller/api/Plugs.php b/app/admin/controller/api/Plugs.php index e4d1e7ccb..852845e05 100644 --- a/app/admin/controller/api/Plugs.php +++ b/app/admin/controller/api/Plugs.php @@ -38,43 +38,6 @@ class Plugs extends Controller $this->fetch(realpath(__DIR__ . '/../../view/api/icon.html')); } - /** - * 网站压缩发布 - * @login true - */ - public function push() - { - if (AdminService::instance()->isSuper()) try { - AdminService::instance()->clearCache(); - SystemService::instance()->pushRuntime(); - $this->success('网站缓存加速成功!'); - } catch (HttpResponseException $exception) { - throw $exception; - } catch (\Exception $exception) { - $this->error($exception->getMessage()); - } else { - $this->error('只有超级管理员才能操作!'); - } - } - - /** - * 清理运行缓存 - * @login true - */ - public function clear() - { - if (AdminService::instance()->isSuper()) try { - AdminService::instance()->clearCache(); - SystemService::instance()->clearRuntime(); - $this->success('清理网站缓存成功!'); - } catch (HttpResponseException $exception) { - throw $exception; - } catch (\Exception $exception) { - $this->error($exception->getMessage()); - } else { - $this->error('只有超级管理员才能操作!'); - } - } /** * 当前运行模式 @@ -157,4 +120,42 @@ class Plugs extends Controller $this->error('只有超级管理员才能操作!'); } } + + /** + * 网站压缩发布 + * @login true + */ + public function pushRuntime() + { + if (AdminService::instance()->isSuper()) try { + AdminService::instance()->clearCache(); + SystemService::instance()->pushRuntime(); + $this->success('网站缓存加速成功!'); + } catch (HttpResponseException $exception) { + throw $exception; + } catch (\Exception $exception) { + $this->error($exception->getMessage()); + } else { + $this->error('只有超级管理员才能操作!'); + } + } + + /** + * 清理运行缓存 + * @login true + */ + public function clearRuntime() + { + if (AdminService::instance()->isSuper()) try { + AdminService::instance()->clearCache(); + SystemService::instance()->clearRuntime(); + $this->success('清理网站缓存成功!'); + } catch (HttpResponseException $exception) { + throw $exception; + } catch (\Exception $exception) { + $this->error($exception->getMessage()); + } else { + $this->error('只有超级管理员才能操作!'); + } + } } \ No newline at end of file diff --git a/app/admin/view/index/index.html b/app/admin/view/index/index.html index 1c97b5704..a3fdc4d69 100644 --- a/app/admin/view/index/index.html +++ b/app/admin/view/index/index.html @@ -48,8 +48,8 @@