修改个人主页的url规则

This commit is contained in:
daihh
2022-10-14 18:29:06 +08:00
parent 56584d7823
commit 164225f67e
13 changed files with 57 additions and 40 deletions

View File

@@ -118,16 +118,9 @@
Profess:[]
}
},
// watch:{
// '$route' (to, from) { //监听路由是否变化
// if(to.query.id != from.query.id && from.path == "/home/index"){
// this.id = to.query.id;
// this.init();//重新加载数据
// }
// }
// },
created(){
if(this.$route.query.id && this.$route.query.id!=''){
this.pageId = this.$xpage.getHomeId(this.$route);
if(this.pageId && this.pageId!=''){
this.init();
}else{
//this.$message.error("参数错误");
@@ -135,12 +128,22 @@
this.$router.push({path:'/404'})
}
},
watch:{
'$route' (to, from) { //监听路由是否变化
console.log(from,'from')
if(to.params.id != from.params.id){
this.pageId = to.params.id;
console.log(this.pageId,'重新加载页面');
this.init();//重新加载数据
}
}
},
mounted() {
},
methods:{
init(){
this.pageId = this.$route.query.id;
this.getList();
if(this.pageId == this.userInfo.aid) {
this.personal = true;