File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 93
93
<!-- 用户信息 -->
94
94
<userData />
95
95
<!-- TitleBar -->
96
- <TitleBar v-if =" showTitleBar " />
96
+ <TitleBar v-if =" checkPlatform.electron() " />
97
97
</div >
98
98
</nav >
99
99
</template >
@@ -122,9 +122,6 @@ const openGithub = () => {
122
122
window .open (packageJson .github );
123
123
};
124
124
125
- // 是否显示 TitleBar
126
- const showTitleBar = computed (() => checkPlatform .electron ());
127
-
128
125
// 主菜单渲染
129
126
const mainMenuShow = ref (false );
130
127
const mainMenuOptions = computed (() => [
Original file line number Diff line number Diff line change @@ -8,7 +8,12 @@ let lastDownloadBlobUrl = null;
8
8
*/
9
9
export const checkPlatform = {
10
10
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" ) ;
12
17
} ,
13
18
macOS : ( ) => {
14
19
if ( ! checkPlatform . electron ( ) ) return false ;
You can’t perform that action at this time.
0 commit comments