diff --git a/src/layout/components/HeaderSys/index.vue b/src/layout/components/HeaderSys/index.vue index a3a5f31..3c5ed9c 100644 --- a/src/layout/components/HeaderSys/index.vue +++ b/src/layout/components/HeaderSys/index.vue @@ -148,13 +148,13 @@ getDataListA(); } /** 获取搜索数据列表 */ -function getDataListA() { +const getDataListA = async () => { projectNoticeUserPage().then(response => { tableData.value = response.data; }); -} +}; /** 获取搜索人数 */ -function getDataList() { +function getDataListB() { countUnread().then(response => { NumPer.value = response.data; }); @@ -165,7 +165,7 @@ } function closed() { dialogNews.value = false; - getDataListA(); + getDataListB(); } onMounted(() => { // 动态获取路由返回子菜单 @@ -183,10 +183,14 @@ bus.on('closeUserCenter', e => { dialogShow.value = false; }); - getDataList(); + bus.on('Refresh', e => { + getDataListB(); + }); + getDataListB(); }); onBeforeUnmount(() => { bus.off('closeUserCenter'); + bus.off('Refresh'); });