Skip to content

Commit

Permalink
添加拉取数据失败时提示
Browse files Browse the repository at this point in the history
  • Loading branch information
unify-z committed Aug 24, 2024
1 parent 0fdabef commit ba6672a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/homepage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import axios from 'axios';
import * as echarts from 'echarts';
import {useDark, useToggle} from '@vueuse/core';
const isDarkMode = useDark();
import {ElMessage} from 'element-plus';
const hitsChart = ref(null);
const bytesChart = ref(null);
Expand Down Expand Up @@ -64,6 +65,10 @@ const fetchData = async () => {
initBytesChart(data.dailyBytes);
} catch (error) {
console.error('Failed to fetch data:', error);
ElMessage({
message: '拉取数据失败:'+ error,
type: 'error'
});
}
};
Expand Down
4 changes: 4 additions & 0 deletions src/rank.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ async function fetchData() {
});
} catch (error) {
console.error('Failed to fetch data:', error);
ElMessage({
message: '拉取数据失败:'+ error,
type: 'error'
});
}
}
Expand Down

0 comments on commit ba6672a

Please sign in to comment.