You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
970 B
34 lines
970 B
3 weeks ago
|
tools.initColor();
|
||
|
|
||
|
|
||
|
var masterVueObj=new Vue({
|
||
|
el: '#liUser',
|
||
|
data: {
|
||
|
userInfo: {
|
||
|
Avatar: 'images/users/avatar.jpg',
|
||
|
UserName: 'ReZero'
|
||
|
}
|
||
|
},
|
||
|
mounted() {
|
||
|
this.fetchUserInfo();
|
||
|
},
|
||
|
methods: {
|
||
|
fetchUserInfo() {
|
||
|
axios.get('/Public/User', jwHeader)
|
||
|
.then(response => {
|
||
|
this.userInfo = response.data;
|
||
|
if (!this.userInfo.Avatar)
|
||
|
{
|
||
|
this.userInfo.Avatar = "images/users/avatar.jpg";
|
||
|
}
|
||
|
if (this.userInfo.IsAdmin == true)
|
||
|
{
|
||
|
document.querySelectorAll('.manager').forEach(element => element.classList.remove('hide'));
|
||
|
}
|
||
|
})
|
||
|
.catch(error => {
|
||
|
console.error('获取用户信息失败:', error);
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
});
|