fix: cannot show message when userGetInfo failed
This commit is contained in:
@@ -11,6 +11,7 @@ import { useStationStore } from '@/stores/station';
|
||||
import { useUserStore } from '@/stores/user';
|
||||
import { AlertFilled, /* AreaChartOutlined, */ FileTextFilled, HomeFilled, LogoutOutlined, VideoCameraFilled } from '@vicons/antd';
|
||||
import { ChevronDown } from '@vicons/carbon';
|
||||
import type { AxiosError } from 'axios';
|
||||
import { NButton, NDropdown, NFlex, NIcon, NLayout, NLayoutContent, NLayoutFooter, NLayoutHeader, NLayoutSider, NMenu, NScrollbar, type DropdownOption, type MenuOption } from 'naive-ui';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { h, onBeforeMount, onBeforeUnmount, ref, type Component, type VNode } from 'vue';
|
||||
@@ -29,7 +30,7 @@ onBeforeUnmount(() => {
|
||||
});
|
||||
|
||||
onBeforeMount(() => {
|
||||
userStore.userGetInfo().catch((err) => window.$message.error(err));
|
||||
userStore.userGetInfo().catch((err) => window.$message.error((err as AxiosError).message));
|
||||
});
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
Reference in New Issue
Block a user