diff --git a/src/components/AppLayout/AppLayout.vue b/src/components/AppLayout/AppLayout.vue index 2ba1043..4e06020 100644 --- a/src/components/AppLayout/AppLayout.vue +++ b/src/components/AppLayout/AppLayout.vue @@ -224,7 +224,8 @@ const badges = ref>({}) async function loadBadges() { try { const data = await fetch('/sys/openapi/inquiry/list?page=1&limit=1', { - headers: { Authorization: `Bearer ${userStore.token}` } + headers: { Authorization: `Bearer ${userStore.token}` }, + credentials: 'omit' }).then(r => r.json()).catch(() => null) if (data?.code === 0) { const total = data.total ?? data.data?.length ?? 0 diff --git a/src/modules/placeholder/PlaceholderView.vue b/src/modules/placeholder/PlaceholderView.vue index a9de8ae..c332eb9 100644 --- a/src/modules/placeholder/PlaceholderView.vue +++ b/src/modules/placeholder/PlaceholderView.vue @@ -83,7 +83,8 @@ async function checkApi() { return } const res = await fetch(apiUrl.value, { - headers: { Authorization: `Bearer ${token}` } + headers: { Authorization: `Bearer ${token}` }, + credentials: 'omit' }) // W4.19 修复:nginx 没代理的业务模块会返 404 HTML 页, 不是 JSON // 检测 content-type 防止误判