fix: 购物车页面未登录时不调用需要认证的API
- fetchAddresses 未登录时跳过 - fetchUserProfile 未登录时跳过(已有) - 避免触发 401 跳转登录页
This commit is contained in:
@@ -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 || []
|
||||
|
||||
Reference in New Issue
Block a user