From 000c41d47558752c177366df79533264db4d2a17 Mon Sep 17 00:00:00 2001 From: yumo Date: Mon, 19 Feb 2024 00:58:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=99=E8=A8=80=E5=A2=9E=E5=8A=A0=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=A0=81=E5=88=A4=E6=96=AD=20page=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=BE=93=E5=87=BAseo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/controller/Index.php | 7 +++++++ app/index/controller/Page.php | 1 + 2 files changed, 8 insertions(+) diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index 7c2bf18..3ef87ae 100644 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -104,11 +104,17 @@ class Index extends Base { if (request()->isPost()) { $data = Util::postMore([ + ['captcha',''], ['author', ''], ['tel', ''], ['email', ''], ['content', ''], ]); + //开始判断留言是否显示验证码,显示则需要判断验证码 + if ($data['captcha'] != "" && !captcha_check($data['captcha'])){ + // 验证码验证 + $this->error('验证码不正确', null); + } $data['create_time'] = time(); $data['reply_content'] = ''; $messageFormValidate = new MsgValidate(); @@ -165,6 +171,7 @@ class Index extends Base } $article['category_title'] = "单页"; //判断SEO 为空则取系统 + $article['meta_title'] = $article['title']; $article['keywords'] = $article['keywords'] ?: web_config('keywords'); $article['description'] = $article['description'] ?: web_config('description'); //输出文章内容 diff --git a/app/index/controller/Page.php b/app/index/controller/Page.php index d468f92..5314e06 100644 --- a/app/index/controller/Page.php +++ b/app/index/controller/Page.php @@ -61,6 +61,7 @@ class Page extends Base } $article['category_title'] = "单页"; //判断SEO 为空则取系统 + $article['meta_title'] = $article['title']; $article['keywords'] = $article['keywords'] ?: web_config('keywords'); $article['description'] = $article['description'] ?: web_config('description'); //输出文章内容