ソースを参照

个人账户信息更新

Xiao_123 4 ヶ月 前
コミット
30879b59f8

+ 1 - 13
src/layout/index.vue

@@ -22,9 +22,8 @@ import NavBar from './personal/navBar.vue'
 import Footers from './personal/footer.vue'
 import Slider from './personal/slider.vue'
 import { useSharedState } from '@/store/sharedState'
-import { useRouter, useRoute } from 'vue-router'
+import { useRouter } from 'vue-router'
 import { useMallStore } from '@/store/mall'
-import { useUserStore } from '@/store/user'
 
 // 不展示侧边栏名单
 const whiteList = ['/login', '/privacyPolicy', '/userAgreement', '/register', '/recruit/personal/advertisement/introduce']
@@ -39,9 +38,7 @@ const footerWhiteList = [
   '/recruit/personal/resume/analysis',
   '/mall/pointExchange/records'
 ]
-const route = useRoute()
 const router = useRouter()
-const user = useUserStore()
 const sharedState = useSharedState()
 
 const layoutClick = () => {
@@ -51,15 +48,6 @@ const layoutClick = () => {
 onMounted(async () => {
   await useMallStore().getMallDiyTemplate()
 })
-
-watch(
-  () => route.matched,
-  async () => {
-    await user.getUserAccountInfo()
-  },
-  { immediate: true },
-  { deep: true }
-)
 </script>
 
 <style lang="scss" scoped>

+ 8 - 0
src/views/publicRecruitment/myRecommendation.vue

@@ -32,6 +32,7 @@ import {
 } from '@/api/publicRecruitment'
 import TablePage from './components/table.vue'
 // import bountyDisplay from './components/bountyDisplay.vue'
+import { useUserStore } from '@/store/user'
 
 const active = ref(0)
 // 数据统计
@@ -87,6 +88,13 @@ const handleStatisticsItem = (item, index) => {
   query.value.status = item.value
   getTableList()
 }
+
+// 更新账户信息
+const store = useUserStore()
+const updateAccountInfo = async () => {
+  await store.getUserAccountInfo()
+}
+updateAccountInfo()
 </script>
 
 <style lang="scss" scoped>

+ 9 - 1
src/views/recruit/personal/PersonalCenter/index.vue

@@ -51,6 +51,7 @@ defineOptions({ name: 'person-center'})
 import { computed } from 'vue'
 import { getCurrentLocaleLang } from '@/utils/lang.js'
 import personCenterRoute from '@/router/modules/components/recruit/personCenter'
+import { useUserStore } from '@/store/user'
 
 // 左侧菜单列表
 const list = computed(() => {
@@ -75,7 +76,14 @@ const getList = (arr, obj = []) => {
     obj.push(data)
   })
   return obj
-} 
+}
+
+const userStore = useUserStore()
+// 更新账户信息
+const updateAccountInfo = async () => {
+  await userStore.getUserAccountInfo()
+}
+updateAccountInfo()
 </script>
 
 <style scoped lang="scss">