aritcle add edit cache

This commit is contained in:
toogee 2020-05-18 17:16:41 +08:00
parent 987adc6b5f
commit 6ee23c779e

View File

@ -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);