fix:修改错误提示
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user