mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-26 10:40:26 +08:00
✨ Feature(custom): optimize i18n and platform funcs
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user