fix: 购物车页面未登录时不调用需要认证的API
Build and Push Docker Image / build-and-push (push) Successful in 1m1s
Build and Push Docker Image / deploy (push) Successful in 7s

- fetchAddresses 未登录时跳过
- fetchUserProfile 未登录时跳过(已有)
- 避免触发 401 跳转登录页
This commit is contained in:
2026-07-13 03:48:57 +00:00
parent dcb187502d
commit ae28aa8ae8
+4
View File
@@ -482,6 +482,10 @@ async function fetchPaymentChannels() {
} }
async function fetchAddresses() { async function fetchAddresses() {
// 未登录时静默跳过
const token = localStorage.getItem('token')
if (!token) return
try { try {
const res: any = await addressApi.list() const res: any = await addressApi.list()
addresses.value = res.data || [] addresses.value = res.data || []