diff --git a/app/index/controller/Article.php b/app/index/controller/Article.php index e68c300..38325bd 100644 --- a/app/index/controller/Article.php +++ b/app/index/controller/Article.php @@ -127,7 +127,7 @@ class Article extends BaseController ]); break; } - Cache::set('arts'.$ename.$type.$page,$artList,600); + Cache::tag('tagArtDetail')->set('arts'.$ename.$type.$page,$artList,600); } @@ -238,6 +238,8 @@ class Article extends BaseController if($result == 1) { $aid = Db::name('article')->max('id'); $link = (string) url('article/detail',['id'=> $aid]); + //清除文章tag缓存 + Cache::tag('tagArtDetail')->clear(); return json(['code'=>1,'msg'=>'发布成功','url'=> $link]); } else { $this->error($result);