用户上传完善
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<el-avatar shape="square" style=" cursor: pointer;box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)" :src="imageUrl" size="large">{{this.$cookie.get('username')}}</el-avatar>
|
||||
<div style="margin-left: 5px;display: flex;flex-direction: column;justify-content: space-evenly">
|
||||
<span style="cursor: pointer;font-weight: bold">{{this.$cookie.get('username')}}</span>
|
||||
<span style="cursor: pointer;font-weight: 800;font-size: 13px;color: #3b82f6">Lv.1</span>
|
||||
<span style="cursor: pointer;font-weight: 800;font-size: 13px;color: #3b82f6">Lv.{{userLevel}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -39,11 +39,20 @@ export default {
|
||||
switchValue:false,
|
||||
ContributionValue:0,
|
||||
imageUrl:'',
|
||||
userLevel:null,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.updateUserLevel();
|
||||
this.getUserInfo();
|
||||
},
|
||||
mounted() {
|
||||
this.getContributionValue();
|
||||
this.getUserInfo();
|
||||
setTimeout(()=>{
|
||||
this.updateUserLevel();
|
||||
this.getUserInfo();
|
||||
},1000)
|
||||
},
|
||||
methods: {
|
||||
signOut() {
|
||||
@@ -124,15 +133,29 @@ export default {
|
||||
username: this.$cookie.get("username")
|
||||
}
|
||||
}).then(function (res) {
|
||||
that.imageUrl = res.data.userAvatar;
|
||||
that.userLevel=res.data.userLevel;
|
||||
// that.imageUrl = res.data.userAvatar;
|
||||
// console.log(res);
|
||||
});
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
},
|
||||
updateUserLevel(){
|
||||
if(this.$cookie.get("username")!=null){
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: 'http://localhost:8082/helloGithub_war_exploded/levelup',
|
||||
// URL 中的查询参数
|
||||
params: {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user