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