Browse Source

[Mod 0000] 修改Header右边userdropdown的展示逻辑

houzekong 11 months ago
parent
commit
535652d189
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/layouts/default/header/index.vue

+ 4 - 3
src/layouts/default/header/index.vue

@@ -56,7 +56,7 @@
     style="position: fixed; top: 30px; right: 20px; z-index: 999"
   >
     <div class="right-position">
-      <UserDropDown :theme="getHeaderTheme" />
+      <UserDropDown v-if="showUserDropdown" :theme="getHeaderTheme" />
     </div>
   </div>
   <LoginSelect ref="loginSelectRef" @success="loginSelectOk" />
@@ -93,7 +93,6 @@
   import { useRouter } from 'vue-router';
 
   import { noHeadeLink } from '../layout.data';
-  import { AUTO_LOGIN_URL_QUERY } from '/@/router/constant';
 
   export default defineComponent({
     name: 'LayoutHeader',
@@ -210,8 +209,10 @@
         console.log('成功。。。。。');
       }
 
+      // 用户下拉框应该在以下情况中隐藏:
+      // 1. 本页面是由其他页面的 iframe 嵌入的页面
       const showUserDropdown = computed(() => {
-        return currentRoute.value.query[AUTO_LOGIN_URL_QUERY.key] === AUTO_LOGIN_URL_QUERY.val;
+        return window.self === window.top;
       });
 
       onMounted(() => {