修改切换逻辑
This commit is contained in:
parent
3a836fbe70
commit
1d8f10c94d
|
@ -16,8 +16,8 @@
|
|||
<MenuItem key="account" :text="t('layout.header.dropdownItemSwitchAccount')" icon="ant-design:setting-outlined" />
|
||||
<MenuItem key="password" :text="t('layout.header.dropdownItemSwitchPassword')" icon="ant-design:edit-outlined" />
|
||||
<MenuItem key="depart" :text="t('layout.header.dropdownItemSwitchDepart')" icon="ant-design:cluster-outlined" />
|
||||
<MenuItem key="qhzh" :text="t('layout.header.dropdownItemSwitchUser')" icon="ant-design:cluster-outlined" />
|
||||
<MenuItem key="cache" v-if="adminRole" :text="t('layout.header.dropdownItemRefreshCache')" icon="ion:sync-outline" />
|
||||
<MenuItem key="qhzh" v-if="adminRole" :text="t('layout.header.dropdownItemSwitchUser')" icon="ant-design:cluster-outlined" />
|
||||
<!-- <MenuItem key="cache" v-if="adminRole" :text="t('layout.header.dropdownItemRefreshCache')" icon="ion:sync-outline" /> -->
|
||||
<!-- <MenuItem
|
||||
v-if="getUseLockPage"
|
||||
key="lock"
|
||||
|
@ -84,7 +84,7 @@ import { defHttp } from '/@/utils/http/axios';
|
|||
const { getShowDoc, getUseLockPage } = useHeaderSetting();
|
||||
const userStore = useUserStore();
|
||||
const go = useGo();
|
||||
const adminRole = ref(false);
|
||||
const adminRole = ref<boolean>(false);
|
||||
|
||||
const getUserInfo = computed(() => {
|
||||
const { realname = '', avatar, desc } = userStore.getUserInfo || {};
|
||||
|
@ -107,11 +107,13 @@ import { defHttp } from '/@/utils/http/axios';
|
|||
const loginSelectRef = ref();
|
||||
|
||||
defHttp.get({ url: '/sys/user/queryUserRole',params:{userid:userStore.getUserInfo.id} }).then((res) => {
|
||||
console.log('--->',res);
|
||||
console.log('1111--->',res);
|
||||
if (res.length>0) {
|
||||
res.forEach((item=>{
|
||||
console.log('2222--->',item);
|
||||
if(item == 'f6817f48af4fb3af11b9e8bf182f618b'){
|
||||
adminRole.value = true;
|
||||
console.log('33333333--->',adminRole.value);
|
||||
}
|
||||
}))
|
||||
|
||||
|
@ -206,6 +208,7 @@ import { defHttp } from '/@/utils/http/axios';
|
|||
loginSelectRef,
|
||||
updatePasswordRef,
|
||||
qiehuanzhanghaoRef,
|
||||
adminRole,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue