Feature(custom): optimize get config speed

This commit is contained in:
Kuingsmile
2024-06-09 21:05:30 +08:00
parent 19c12b6b02
commit 106290f868
20 changed files with 57 additions and 55 deletions
+7 -1
View File
@@ -5,6 +5,7 @@ import { OPEN_URL } from '#/events/constants'
import { ILogType } from '#/types/enum'
const isDevelopment = process.env.NODE_ENV !== 'production'
export const handleTalkingDataEvent = (data: ITalkingDataOptions) => {
const { EventId, Label = '', MapKv = {} } = data
MapKv.from = window.location.href
@@ -31,11 +32,16 @@ export const getRawData = (args: any): any => {
return args
}
function sendToMain (channel: string, ...args: any[]) {
export function sendToMain (channel: string, ...args: any[]) {
const data = getRawData(args)
ipcRenderer.send(channel, ...data)
}
export function invokeToMain (channel: string, ...args: any[]) {
const data = getRawData(args)
return ipcRenderer.invoke(channel, ...data)
}
export const openURL = (url: string) => {
sendToMain(OPEN_URL, url)
}