Skip to content

Commit e7c17cf

Browse files
committed
🐞 fix: 修复偶发性客户端状态栏异常
1 parent c6a1ca4 commit e7c17cf

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/components/Nav/MainNav.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
<!-- 用户信息 -->
9494
<userData />
9595
<!-- TitleBar -->
96-
<TitleBar v-if="showTitleBar" />
96+
<TitleBar v-if="checkPlatform.electron()" />
9797
</div>
9898
</nav>
9999
</template>
@@ -122,9 +122,6 @@ const openGithub = () => {
122122
window.open(packageJson.github);
123123
};
124124
125-
// 是否显示 TitleBar
126-
const showTitleBar = computed(() => checkPlatform.electron());
127-
128125
// 主菜单渲染
129126
const mainMenuShow = ref(false);
130127
const mainMenuOptions = computed(() => [

src/utils/helper.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ let lastDownloadBlobUrl = null;
88
*/
99
export const checkPlatform = {
1010
electron: () => {
11-
return typeof electron !== "undefined";
11+
// return typeof electron !== "undefined";
12+
if (typeof process !== "undefined" && process.versions) {
13+
return process.versions.electron ? true : false;
14+
}
15+
const userAgent = navigator.userAgent.toLowerCase();
16+
return userAgent.includes("electron");
1217
},
1318
macOS: () => {
1419
if (!checkPlatform.electron()) return false;

0 commit comments

Comments
 (0)