|
|
@@ -102,12 +102,17 @@ export default {
|
|
|
// 是否显示主题设置抽屉
|
|
|
settingVisible: false,
|
|
|
groupId: '',
|
|
|
- roleId: ''
|
|
|
+ roleId: '',
|
|
|
+ currentUser:{
|
|
|
+ currentGroupId:'',
|
|
|
+ currentRoleId:''
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- this.groupId = this.$store.state.user?.info.currentGroupId;
|
|
|
- this.roleId = this.$store.state.user?.info.currentRoleId;
|
|
|
+ this.currentUser = JSON.parse(sessionStorage['currentUser']);
|
|
|
+ this.groupId = this.currentUser.currentGroupId;
|
|
|
+ this.roleId = this.currentUser.currentRoleId;
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
|
@@ -132,13 +137,14 @@ export default {
|
|
|
},
|
|
|
roleChange(val) {
|
|
|
this.roleId = val;
|
|
|
- let userInfo=this.$store.state.user?.info
|
|
|
- userInfo.currentGroupId=this.groupId
|
|
|
- userInfo.currentRoleId=val
|
|
|
- this.$store.dispatch('user/fetchUserInfo').then(({ menus, homePath, authoritiesRouter })=>{
|
|
|
- router.roleChange({ menus, homePath, authoritiesRouter })
|
|
|
- });
|
|
|
-
|
|
|
+ this.currentUser.currentGroupId = this.groupId;
|
|
|
+ this.currentUser.currentRoleId = val;
|
|
|
+ sessionStorage['currentUser']=JSON.stringify(this.currentUser)
|
|
|
+ this.$store
|
|
|
+ .dispatch('user/fetchUserInfo')
|
|
|
+ .then(({ menus, homePath, authoritiesRouter }) => {
|
|
|
+ router.roleChange({ menus, homePath, authoritiesRouter });
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
/* 用户信息下拉点击事件 */
|