|
@@ -94,6 +94,7 @@
|
|
|
import { userLogout } from '@/api/system/user';
|
|
import { userLogout } from '@/api/system/user';
|
|
|
import { SYSTEM_NAME } from '@/config/setting';
|
|
import { SYSTEM_NAME } from '@/config/setting';
|
|
|
import router from '@/router/index';
|
|
import router from '@/router/index';
|
|
|
|
|
+ import { getCurrentUser,setCurrentUser } from '@/utils/token-util';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: { HeaderNotice, PasswordModal, SettingDrawer, I18nIcon },
|
|
components: { HeaderNotice, PasswordModal, SettingDrawer, I18nIcon },
|
|
@@ -116,7 +117,7 @@
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- this.currentUser = JSON.parse(sessionStorage['currentUser']);
|
|
|
|
|
|
|
+ this.currentUser = getCurrentUser()
|
|
|
this.groupId = this.currentUser.currentGroupId;
|
|
this.groupId = this.currentUser.currentGroupId;
|
|
|
this.roleId = this.currentUser.currentRoleId;
|
|
this.roleId = this.currentUser.currentRoleId;
|
|
|
},
|
|
},
|
|
@@ -144,7 +145,7 @@
|
|
|
this.roleId = val;
|
|
this.roleId = val;
|
|
|
this.currentUser.currentGroupId = this.groupId;
|
|
this.currentUser.currentGroupId = this.groupId;
|
|
|
this.currentUser.currentRoleId = val;
|
|
this.currentUser.currentRoleId = val;
|
|
|
- sessionStorage['currentUser'] = JSON.stringify(this.currentUser);
|
|
|
|
|
|
|
+ setCurrentUser(this.currentUser)
|
|
|
this.$store
|
|
this.$store
|
|
|
.dispatch('user/fetchUserInfo')
|
|
.dispatch('user/fetchUserInfo')
|
|
|
.then(({ menus, homePath, authoritiesRouter }) => {
|
|
.then(({ menus, homePath, authoritiesRouter }) => {
|