mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-23 01:36:44 +08:00
个人主页增加关闭设置
This commit is contained in:
@@ -3,7 +3,10 @@
|
||||
<top></top>
|
||||
<div style="height:72px"></div>
|
||||
<UcHeader></UcHeader>
|
||||
<div class="home-page-box">
|
||||
<div v-show="showHomeNum==1">
|
||||
<div style="text-align: center;padding-top: 100px;font-size: 26px;color: #cccccc;">此用户已关闭个人主页</div>
|
||||
</div>
|
||||
<div v-show="showHomeNum==2" class="home-page-box">
|
||||
<router-view />
|
||||
<div class="home-page-right">
|
||||
<ul class="total-per">
|
||||
@@ -42,6 +45,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -64,6 +68,7 @@
|
||||
data(){
|
||||
return{
|
||||
baseUrl:process.env.VUE_APP_FILE_BASE_URL,
|
||||
showHomeNum:0,
|
||||
self:false,
|
||||
input:'',
|
||||
activeName:'first',
|
||||
@@ -82,7 +87,30 @@
|
||||
if(!this.pageId){
|
||||
this.$router.push({path:'/404'})
|
||||
}else{
|
||||
this.init();
|
||||
//代表不是自己的主页
|
||||
let $this=this;
|
||||
if(this.pageId!=this.userInfo.aid){
|
||||
apiUser.home(this.pageId).then(res=>{
|
||||
if(res.status==200){
|
||||
if(res.result.showHome){
|
||||
$this.showHomeNum=2;
|
||||
this.init();
|
||||
}else{
|
||||
$this.showHomeNum=1;
|
||||
}
|
||||
}else{
|
||||
//如果加载失败,也是显示内容
|
||||
this.showHomeNum=2;
|
||||
this.init();
|
||||
}
|
||||
})
|
||||
|
||||
}else{
|
||||
this.showHomeNum=2;
|
||||
this.init();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
},
|
||||
watch:{
|
||||
'$route' (to, from) { //监听路由是否变化
|
||||
|
||||
|
||||
if(to.params.id != from.params.id){
|
||||
this.pageId = to.params.id;
|
||||
let urlPre=window.location.protocol+'//'+window.location.host;
|
||||
|
||||
@@ -268,9 +268,9 @@
|
||||
//执行隐藏操作
|
||||
userApi.updateShowHome(!this.hideHome).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.userInfo.showHome = !this.hideHome;
|
||||
this.$message.success('修改成功');
|
||||
this.$store.dispatch('InitData');
|
||||
//this.userInfo.showHome = !this.hideHome;
|
||||
this.$message.success('修改成功');
|
||||
this.$store.dispatch('InitData');
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user