留言增加验证码判断

page统一页面输出seo
This commit is contained in:
yumo 2024-02-19 00:58:07 +08:00
parent b2cfc6d619
commit 000c41d475
2 changed files with 8 additions and 0 deletions

View File

@ -104,11 +104,17 @@ class Index extends Base
{ {
if (request()->isPost()) { if (request()->isPost()) {
$data = Util::postMore([ $data = Util::postMore([
['captcha',''],
['author', ''], ['author', ''],
['tel', ''], ['tel', ''],
['email', ''], ['email', ''],
['content', ''], ['content', ''],
]); ]);
//开始判断留言是否显示验证码,显示则需要判断验证码
if ($data['captcha'] != "" && !captcha_check($data['captcha'])){
// 验证码验证
$this->error('验证码不正确', null);
}
$data['create_time'] = time(); $data['create_time'] = time();
$data['reply_content'] = ''; $data['reply_content'] = '';
$messageFormValidate = new MsgValidate(); $messageFormValidate = new MsgValidate();
@ -165,6 +171,7 @@ class Index extends Base
} }
$article['category_title'] = "单页"; $article['category_title'] = "单页";
//判断SEO 为空则取系统 //判断SEO 为空则取系统
$article['meta_title'] = $article['title'];
$article['keywords'] = $article['keywords'] ?: web_config('keywords'); $article['keywords'] = $article['keywords'] ?: web_config('keywords');
$article['description'] = $article['description'] ?: web_config('description'); $article['description'] = $article['description'] ?: web_config('description');
//输出文章内容 //输出文章内容

View File

@ -61,6 +61,7 @@ class Page extends Base
} }
$article['category_title'] = "单页"; $article['category_title'] = "单页";
//判断SEO 为空则取系统 //判断SEO 为空则取系统
$article['meta_title'] = $article['title'];
$article['keywords'] = $article['keywords'] ?: web_config('keywords'); $article['keywords'] = $article['keywords'] ?: web_config('keywords');
$article['description'] = $article['description'] ?: web_config('description'); $article['description'] = $article['description'] ?: web_config('description');
//输出文章内容 //输出文章内容