- {{ userNameF }}
+ {{ userNameF }}
@@ -125,22 +125,33 @@
}
},
created() {
- var userInfo = this.$TOOL.data.get("USER_INFO");
- this.userName = userInfo.name;
- this.userNameF = this.userName.substring(0, 1);
+ const userInfo = this.$TOOL.data.get("USER_INFO");
+
+ this.$store.commit("SET_LOGIN_AVATAR", userInfo.avatar);
+ this.$store.commit("SET_LOGIN_NAME", userInfo.name);
+
+ this.userName = this.$store.state.global.login_name;
+ if(userInfo.company_info){
+ this.companyName = userInfo.company_info.name;
+ }
+ if(this.userName!=''){
+ this.userNameF = this.userName.substring(0, 1);
+ }
+ this.avatar = this.$store.state.global.login_avatar;
+ this.userId = userInfo.id;
},
methods: {
//个人信息
handleUser(command) {
if (command == "uc") {
- this.$router.push({ path: '/usercenter' });
+ this.$router.push({ path: '/user/center' });
}
if (command == "cmd") {
this.$router.push({ path: '/cmd' });
}
if (command == "clearCache") {
- this.$confirm('清除缓存会将系统初始化,包括登录状态、主题、语言设置等,是否继续?', '提示', {
- type: 'info',
+ this.$confirm('清除缓存会将系统初始化,包括登录状态、主题、语言设置等,是否继续?', '警告', {
+ type: 'warning',
}).then(() => {
const loading = this.$loading()
this.$TOOL.data.clear()
@@ -154,7 +165,7 @@
})
}
if (command == "outLogin") {
- this.$confirm('确认是否退出当前用户?', '提示', {
+ this.$confirm('确认是否退出当前用户?', '警告', {
type: 'warning',
confirmButtonText: '退出',
confirmButtonClass: 'el-button--danger'
diff --git a/src/layout/index.vue b/src/layout/index.vue
index 4ff8523..cd4157a 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -55,8 +55,8 @@