From 70c350b866bd878a0fa8526d237f1cbac63e7f3a Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Sat, 22 Nov 2025 14:45:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=91=8A=E7=AE=A1=E7=90=86=E6=9D=83?= =?UTF-8?q?=E9=99=90=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/notice/create/index.vue | 21 +++++++++++++++++++++ pages/notice/detail/index.vue | 18 ++++++++++++++++++ pages/notice/edit/index.vue | 22 ++++++++++++++++++++++ 3 files changed, 61 insertions(+) diff --git a/pages/notice/create/index.vue b/pages/notice/create/index.vue index a405be3..08fb0c3 100644 --- a/pages/notice/create/index.vue +++ b/pages/notice/create/index.vue @@ -212,7 +212,9 @@ diff --git a/pages/notice/detail/index.vue b/pages/notice/detail/index.vue index 5370584..1d75e10 100644 --- a/pages/notice/detail/index.vue +++ b/pages/notice/detail/index.vue @@ -341,6 +341,15 @@ const previewAttachment = (attach) => { // 编辑公告 const handleEdit = () => { + // 权限检查:只有 admin 和 sys_admin 可以编辑公告 + if (!isAdmin.value) { + uni.showToast({ + title: '无权限操作', + icon: 'none' + }); + return; + } + if (!noticeId.value) { uni.showToast({ title: '公告ID无效', @@ -356,6 +365,15 @@ const handleEdit = () => { // 删除公告 const handleDelete = async () => { + // 权限检查:只有 admin 和 sys_admin 可以删除公告 + if (!isAdmin.value) { + uni.showToast({ + title: '无权限操作', + icon: 'none' + }); + return; + } + if (!noticeId.value) { uni.showToast({ title: '公告ID无效', diff --git a/pages/notice/edit/index.vue b/pages/notice/edit/index.vue index 24df02d..d24c5c1 100644 --- a/pages/notice/edit/index.vue +++ b/pages/notice/edit/index.vue @@ -215,7 +215,9 @@