diff --git a/utils/api.js b/utils/api.js index 3417675..feceb49 100755 --- a/utils/api.js +++ b/utils/api.js @@ -17,7 +17,7 @@ let loginLock = null; let loadingCount = 0; const showLoading = () => { if (loadingCount === 0) { - uni.$u.toast.loading('加载中...'); + uni.showLoading({ title: '加载中...', mask: true }); } loadingCount++; }; @@ -25,7 +25,7 @@ const hideLoading = () => { loadingCount--; if (loadingCount <= 0) { loadingCount = 0; - uni.$u.toast.hide(); + uni.hideLoading(); } }; @@ -196,7 +196,7 @@ const requestWithRetry = async (url, method = 'GET', data = {}, headers = {}, re return await requestWithRetry(url, method, data, headers, retryCount + 1); } else { console.error('❌ 达到最大重试次数'); - uni.$u.toast.error('系统异常,请稍后重试'); + uni.showToast({ title: '系统异常,请稍后重试', icon: 'none' }); throw new Error('登录已过期,重试次数超限'); } } else {