From ae28aa8ae886fc6bff5c50297fb9a172f916e8ea Mon Sep 17 00:00:00 2001 From: Admin Date: Mon, 13 Jul 2026 03:48:57 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B4=AD=E7=89=A9=E8=BD=A6=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=9C=AA=E7=99=BB=E5=BD=95=E6=97=B6=E4=B8=8D=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E9=9C=80=E8=A6=81=E8=AE=A4=E8=AF=81=E7=9A=84API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fetchAddresses 未登录时跳过 - fetchUserProfile 未登录时跳过(已有) - 避免触发 401 跳转登录页 --- frontend/src/views/user/Cart.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/views/user/Cart.vue b/frontend/src/views/user/Cart.vue index d2f1f6b..ab6f6e1 100644 --- a/frontend/src/views/user/Cart.vue +++ b/frontend/src/views/user/Cart.vue @@ -482,6 +482,10 @@ async function fetchPaymentChannels() { } async function fetchAddresses() { + // 未登录时静默跳过 + const token = localStorage.getItem('token') + if (!token) return + try { const res: any = await addressApi.list() addresses.value = res.data || []