From 75fe10a3cee41ecb279d001f0b05bc0959a1b178 Mon Sep 17 00:00:00 2001 From: 18278715334 <18278715334@163.com> Date: Tue, 13 Jan 2026 14:55:16 +0800 Subject: [PATCH] f --- src/layouts/GlobalLayout.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/layouts/GlobalLayout.vue b/src/layouts/GlobalLayout.vue index f98df9f..77ccad3 100644 --- a/src/layouts/GlobalLayout.vue +++ b/src/layouts/GlobalLayout.vue @@ -33,8 +33,9 @@ const getGlobalNotify = async () => { .get() .json() - if (data.value && !error.value) { - if (data.value !== 200) { + if (data.value && !error.value && data.value.code === 200) { + // 安全检查:确保 data.data 和 notifications 存在 + if (data.value.data && data.value.data.notifications) { notify.value = data.value.data.notifications checkNotification() // 在获取数据后检查通知 }