From 977e2f98752f63ba26c55f4b8f49b864360e7227 Mon Sep 17 00:00:00 2001 From: augushong Date: Thu, 8 Sep 2022 09:19:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=BC=93=E5=AD=98=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/controller/Index.php | 67 +--------------------------------- app/index/controller/Post.php | 67 +--------------------------------- 2 files changed, 2 insertions(+), 132 deletions(-) diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index 9c7632d..b6b9b70 100644 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -97,7 +97,7 @@ class Index extends Common $content = View::fetch(); - Cache::tag('page_cache')->set($page_cache_key, $content); + Cache::tag('page_cache')->set($page_cache_key, $content, 600); return $content; } @@ -111,69 +111,4 @@ class Index extends Common return $this->success('退出成功', $back_url); } - /** - * 显示创建资源表单页. - * - * @return \think\Response - */ - public function create() - { - // - } - - /** - * 保存新建的资源 - * - * @param \think\Request $request - * @return \think\Response - */ - public function save(Request $request) - { - // - } - - /** - * 显示指定的资源 - * - * @param int $id - * @return \think\Response - */ - public function read($id) - { - // - } - - /** - * 显示编辑资源表单页. - * - * @param int $id - * @return \think\Response - */ - public function edit($id) - { - // - } - - /** - * 保存更新的资源 - * - * @param \think\Request $request - * @param int $id - * @return \think\Response - */ - public function update(Request $request, $id) - { - // - } - - /** - * 删除指定资源 - * - * @param int $id - * @return \think\Response - */ - public function delete($id) - { - // - } } diff --git a/app/index/controller/Post.php b/app/index/controller/Post.php index 1f2469e..0316240 100644 --- a/app/index/controller/Post.php +++ b/app/index/controller/Post.php @@ -12,36 +12,6 @@ use think\Request; class Post extends Common { - /** - * 显示资源列表 - * - * @return \think\Response - */ - public function index() - { - // - } - - /** - * 显示创建资源表单页. - * - * @return \think\Response - */ - public function create() - { - // - } - - /** - * 保存新建的资源 - * - * @param \think\Request $request - * @return \think\Response - */ - public function save(Request $request) - { - // - } /** * 显示指定的资源 @@ -69,7 +39,7 @@ class Post extends Common return $this->error('链接已失效', '/'); } - Cache::set($cache_key, $model_post); + Cache::set($cache_key, $model_post,600); } @@ -82,39 +52,4 @@ class Post extends Common return View::fetch(); } - - - /** - * 显示编辑资源表单页. - * - * @param int $id - * @return \think\Response - */ - public function edit($id) - { - // - } - - /** - * 保存更新的资源 - * - * @param \think\Request $request - * @param int $id - * @return \think\Response - */ - public function update(Request $request, $id) - { - // - } - - /** - * 删除指定资源 - * - * @param int $id - * @return \think\Response - */ - public function delete($id) - { - // - } }