code refactor

This commit is contained in:
MaysWind
2020-11-08 00:40:45 +08:00
parent 9bd341fb0e
commit 7e8b5710c1
12 changed files with 127 additions and 111 deletions
+3 -2
View File
@@ -47,7 +47,8 @@ export default {
return 'v' + this.$version();
},
userNickName() {
return this.$user.getUserNickName() || this.$user.getUserName() || this.$t('User');
const userInfo = this.$user.getUserInfo() || {};
return userInfo.nickname || userInfo.username || this.$t('User');
},
currentLocale: {
get: function () {
@@ -99,7 +100,7 @@ export default {
return;
}
self.$user.clearToken();
self.$user.clearTokenAndUserInfo();
router.navigate('/');
}).catch(error => {
self.logouting = false;