mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-06-08 17:20:00 +08:00
✨ Feature(custom): split i18n in main and renderer, use vue-i18n
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
import pkg from 'root/package.json'
|
||||
|
||||
import { handleTalkingDataEvent } from '@/utils/common'
|
||||
import { TALKING_DATA_APPID, TALKING_DATA_EVENT } from '#/events/constants'
|
||||
import { ITalkingDataOptions } from '#/types/types'
|
||||
|
||||
const { version } = pkg
|
||||
|
||||
export const initTalkingData = () => {
|
||||
setTimeout(() => {
|
||||
const talkingDataScript = document.createElement('script')
|
||||
|
||||
talkingDataScript.src = `http://sdk.talkingdata.com/app/h5/v1?appid=${TALKING_DATA_APPID}&vn=${version}&vc=${version}`
|
||||
|
||||
const head = document.getElementsByTagName('head')[0]
|
||||
head.appendChild(talkingDataScript)
|
||||
}, 0)
|
||||
}
|
||||
|
||||
window.electron.ipcRendererOn(TALKING_DATA_EVENT, (_, data: ITalkingDataOptions) => {
|
||||
handleTalkingDataEvent(data)
|
||||
})
|
||||
@@ -1,17 +1,5 @@
|
||||
import { isReactive, isRef, toRaw, unref } from 'vue'
|
||||
|
||||
import { ITalkingDataOptions } from '#/types/types'
|
||||
|
||||
export const handleTalkingDataEvent = (data: ITalkingDataOptions) => {
|
||||
try {
|
||||
const { EventId, Label = '', MapKv = {} } = data
|
||||
MapKv.from = window.location.href
|
||||
window.TDAPP.onEvent(EventId, Label, MapKv)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get raw data from reactive or ref
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { IRPCActionType } from 'root/src/universal/types/enum'
|
||||
|
||||
import { IRPCActionType } from '#/types/enum'
|
||||
import { IObj } from '#/types/types'
|
||||
|
||||
export function saveConfig (config: IObj | string, value?: any) {
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
import { ILogType, IRPCActionType } from '#/types/enum'
|
||||
|
||||
export const deleteLog = (fileName?: string, type?: string, isSuccess = true, msg?: string) => {
|
||||
window.electron.sendRPC(
|
||||
IRPCActionType.GALLERY_LOG_DELETE_MSG,
|
||||
msg || `Delete ${fileName} on ${type} success`,
|
||||
isSuccess ? ILogType.success : ILogType.error
|
||||
)
|
||||
}
|
||||
|
||||
export const deleteFailedLog = (fileName: string, type: string, error: any) => {
|
||||
deleteLog(fileName, type, false)
|
||||
window.electron.sendRPC(IRPCActionType.GALLERY_LOG_DELETE_MSG, error, ILogType.error)
|
||||
}
|
||||
Reference in New Issue
Block a user