diff --git a/HSLink-front/src/components/Index.vue b/HSLink-front/src/components/Index.vue index 9a39dfa..5524b3e 100644 --- a/HSLink-front/src/components/Index.vue +++ b/HSLink-front/src/components/Index.vue @@ -34,7 +34,7 @@ - + @@ -80,9 +80,9 @@ }) }, goPersonalInfo(userId) { - this.$router.push({name: 'personalinfo'}); sessionStorage.setItem("userId",userId); - setTimeout(()=>{location.reload()},500) + this.$refs.child.getUserInfo(); + this.$router.push({name: 'personalinfo'}); }, goMore() { this.$message({ diff --git a/HSLink-front/src/components/PersonalInfo.vue b/HSLink-front/src/components/PersonalInfo.vue index 357b4d5..52e5607 100644 --- a/HSLink-front/src/components/PersonalInfo.vue +++ b/HSLink-front/src/components/PersonalInfo.vue @@ -197,7 +197,10 @@ } }, mounted() { - // setInterval(()=>{ + this.getUserInfo(); + }, + methods: { + getUserInfo() { let userInfo = JSON.parse(sessionStorage.getItem("userInfo")); if (userInfo.user_id === sessionStorage.getItem("userId")) { this.isOwn = true @@ -218,9 +221,7 @@ user_id: r.personalInfo.user_id, } }) - // },1000) - }, - methods: { + }, deleteLetter(id,type) { this.$confirm('删除该私信?, 是否继续?', '删除', { confirmButtonText: '确定',