2
0

fix:修改错误提示

This commit is contained in:
zhongzm
2025-01-10 19:07:31 +08:00
parent b12d8fb218
commit 434767a902
3 changed files with 25 additions and 19 deletions

View File

@@ -279,8 +279,8 @@ function checkAndTriggerAuth(dashboardData: any) {
async function mockDataUpdate() {
try {
const response = await authStore.getDashboardData();
// 检查响应是否有效
if (response && typeof response === 'object') {
// 检查响应是否有效且不是错误响应
if (response && typeof response === 'object' && !response.error) {
// 检查必要的字段是否存在
if (response.balance !== undefined) {
// 更新余额和设备数据
@@ -365,14 +365,16 @@ async function mockDataUpdate() {
});
updateGauge3(opts => updateGaugeData(opts, baseData.value[2]));
} else {
// 静默处理无效数据
console.warn('Invalid dashboard data structure:', response);
}
} else {
// 静默处理无效响应
console.warn('Invalid response:', response);
}
} catch (error) {
// 只记录真正的错误
if (error instanceof Error) {
console.warn('Dashboard data update failed:', error.message);
}
// 静默处理所有错误
console.warn('Dashboard update failed:', error);
}
}