From e5233a0096522fe0a3aaa55dbbd2be5ae9477f5b Mon Sep 17 00:00:00 2001 From: "HDM58\\hdm58" Date: Thu, 25 Jan 2024 18:53:57 +0800 Subject: [PATCH] =?UTF-8?q?#I8XDG7=20=E4=BF=AE=E5=A4=8D=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E8=B6=8A=E6=9D=83=E5=88=A0=E9=99=A4=E4=BB=96=E4=BA=BA=E7=9A=84?= =?UTF-8?q?=E6=96=87=E7=AB=A0=20layui=E5=8D=87=E7=BA=A7=E5=88=B02.9.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/article/controller/Index.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/article/controller/Index.php b/app/article/controller/Index.php index c2726c1..87f932c 100644 --- a/app/article/controller/Index.php +++ b/app/article/controller/Index.php @@ -238,6 +238,10 @@ class Index extends BaseController public function delete() { $id = get_params("id"); + $admin_id = Db::name('Article')->where('id',$id).value('uid'); + if($admin_id!=$this->uid){ + return to_assign(1, "你不是该知识的创建人,没权限删除"); + } $data['id'] = $id; $data['delete_time'] = time(); if (Db::name('Article')->update($data) !== false) {