个人中心跳转修复

This commit is contained in:
617594538@qq.com 2020-06-08 15:03:58 +08:00
parent 894225cfda
commit 199286ab2e
2 changed files with 8 additions and 7 deletions

View File

@ -34,7 +34,7 @@
</el-menu> </el-menu>
</el-aside> </el-aside>
<el-main> <el-main>
<router-view></router-view> <router-view ref="child"></router-view>
</el-main> </el-main>
</el-container> </el-container>
</el-container> </el-container>
@ -80,9 +80,9 @@
}) })
}, },
goPersonalInfo(userId) { goPersonalInfo(userId) {
this.$router.push({name: 'personalinfo'});
sessionStorage.setItem("userId",userId); sessionStorage.setItem("userId",userId);
setTimeout(()=>{location.reload()},500) this.$refs.child.getUserInfo();
this.$router.push({name: 'personalinfo'});
}, },
goMore() { goMore() {
this.$message({ this.$message({

View File

@ -197,7 +197,10 @@
} }
}, },
mounted() { mounted() {
// setInterval(()=>{ this.getUserInfo();
},
methods: {
getUserInfo() {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo")); let userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
if (userInfo.user_id === sessionStorage.getItem("userId")) { if (userInfo.user_id === sessionStorage.getItem("userId")) {
this.isOwn = true this.isOwn = true
@ -218,9 +221,7 @@
user_id: r.personalInfo.user_id, user_id: r.personalInfo.user_id,
} }
}) })
// },1000) },
},
methods: {
deleteLetter(id,type) { deleteLetter(id,type) {
this.$confirm('删除该私信?, 是否继续?', '删除', { this.$confirm('删除该私信?, 是否继续?', '删除', {
confirmButtonText: '确定', confirmButtonText: '确定',