Feature(custom): optimize i18n and platform funcs

This commit is contained in:
Kuingsmile
2025-08-01 13:38:37 +08:00
parent 15e2f11b69
commit 70396c3e5c
38 changed files with 16 additions and 164 deletions

View File

@@ -3,8 +3,8 @@ import { ref } from 'vue'
import { IRPCActionType } from '#/types/enum'
import { IPicBedType } from '#/types/types'
console.log('global.ts loaded', window.node.crypto.randomBytes(16).toString('hex'))
const osGlobal = ref<string>(window.electron.sendRpcSync(IRPCActionType.GET_PLATFORM))
console.log('global.ts loaded', window.electron.platform)
const osGlobal = ref<string>(window.electron.platform)
const picBedGlobal = ref<IPicBedType[]>([])
const pageReloadCount = ref(0)

View File

@@ -1,5 +1,3 @@
import { IRPCActionType } from '#/types/enum'
const isSpecialKey = (key: string) => {
const keyArr = ['Shift', 'Control', 'Alt', 'Meta']
@@ -7,7 +5,7 @@ const isSpecialKey = (key: string) => {
}
const keyBinding = (event: KeyboardEvent) => {
const meta = window.electron.sendRpcSync(IRPCActionType.GET_PLATFORM) === 'darwin' ? 'Cmd' : 'Super'
const meta = window.electron.platform === 'darwin' ? 'Cmd' : 'Super'
const specialKey = {
Ctrl: event.ctrlKey,
Shift: event.shiftKey,