瀏覽代碼

feat: 支持隐藏菜单

wuwenyi 4 天之前
父節點
當前提交
11d1b57a37
共有 1 個文件被更改,包括 2 次插入 和 1 次删除
  1. 2 1
      src/components/Layout/index.vue

+ 2 - 1
src/components/Layout/index.vue

@@ -16,7 +16,8 @@ import Sidebar from '@/components/Sidebar/index.vue'
 import Navbar from '@/components/Navbar/index.vue'
 import { isEmbedded } from '@/utils/auth'
 
-const embedded = isEmbedded()
+// 嵌入态判定:宿主通过 ?embed=1 显式标记(主),iframe 环境探测兜底
+const embedded = new URLSearchParams(window.location.search).get('embed') === '1' || isEmbedded()
 </script>
 
 <style scoped>