diff --git a/src/layouts/components/HotkeysIntro/index.vue b/src/layouts/components/HotkeysIntro/index.vue index bb453f62..d131c6b5 100644 --- a/src/layouts/components/HotkeysIntro/index.vue +++ b/src/layouts/components/HotkeysIntro/index.vue @@ -18,15 +18,15 @@ onMounted(() => { - Alt + I + {{ settingsStore.os === 'mac' ? '⌥' : 'Alt' }} + I - Alt + S + {{ settingsStore.os === 'mac' ? '⌥' : 'Alt' }} + S - Alt + ` + {{ settingsStore.os === 'mac' ? '⌥' : 'Alt' }} + ` diff --git a/src/layouts/components/Search/index.vue b/src/layouts/components/Search/index.vue index 4a2e8582..7e696a74 100644 --- a/src/layouts/components/Search/index.vue +++ b/src/layouts/components/Search/index.vue @@ -248,7 +248,7 @@ function pageJump(path: listTypes['path'], link: listTypes['link']) {
- Alt + S + {{ settingsStore.os === 'mac' ? '⌥' : 'Alt' }} + S 唤醒搜索面板 diff --git a/src/store/modules/settings.ts b/src/store/modules/settings.ts index b6c8fd5e..6d27bd8f 100644 --- a/src/store/modules/settings.ts +++ b/src/store/modules/settings.ts @@ -31,6 +31,21 @@ const useSettingsStore = defineStore( immediate: true, }) + // 操作系统 + const os = ref<'mac' | 'windows' | 'linux' | 'other'>('other') + const agent = navigator.userAgent.toLowerCase() + switch (true) { + case agent.includes('mac os'): + os.value = 'mac' + break + case agent.includes('windows'): + os.value = 'windows' + break + case agent.includes('linux'): + os.value = 'linux' + break + } + // 页面标题 const title = ref() // 设置网页标题 @@ -92,6 +107,7 @@ const useSettingsStore = defineStore( return { settings, + os, title, setTitle, mode,