mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 20:06:44 +08:00
个人主页增加关闭设置
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
import ajax from '@/utils/xajax.js'
|
||||
|
||||
/**获取home信息*/
|
||||
const home=function(aid) {
|
||||
return ajax.get('/xboe/sys/user/home?aid='+aid);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param {
|
||||
@@ -98,6 +104,7 @@ const findSignDynamic=function (id){
|
||||
}
|
||||
|
||||
export default{
|
||||
home,
|
||||
list,
|
||||
searchLoginName,
|
||||
getByIds,
|
||||
|
||||
@@ -163,6 +163,7 @@ const user = {
|
||||
studyTotalH:studyTotalH,
|
||||
sign:res.result.sign,
|
||||
};
|
||||
//console.log(user,'user');
|
||||
// user.avatar = user.avatar == "" ? require("@/assets/images/user/default.png") : process.env.VUE_APP_FILE_BASE_URL + user.avatar;
|
||||
user.avatar = user.avatar == "" ? "" : process.env.VUE_APP_FILE_BASE_URL + user.avatar;
|
||||
commit('SET_UserInfo', user);
|
||||
|
||||
@@ -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{
|
||||
//代表不是自己的主页
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
//执行隐藏操作
|
||||
userApi.updateShowHome(!this.hideHome).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.userInfo.showHome = !this.hideHome;
|
||||
//this.userInfo.showHome = !this.hideHome;
|
||||
this.$message.success('修改成功');
|
||||
this.$store.dispatch('InitData');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user