Merge b6fcbad720 into bfc07b2a97
This commit is contained in:
commit
7da12e7d38
@ -8,6 +8,7 @@ const modules = {
|
||||
get_system_fonts: 'get_system_fonts',
|
||||
get_app_setting: 'get_app_setting',
|
||||
set_app_setting: 'set_app_setting',
|
||||
get_data_path: 'get_data_path'
|
||||
},
|
||||
player: {
|
||||
invoke_play_music: 'play_music',
|
||||
|
||||
@ -4,6 +4,10 @@ import { getFonts } from '@main/utils/fontManage'
|
||||
|
||||
// 公共操作事件(公共,只注册一次)
|
||||
export default () => {
|
||||
mainHandle<string>(CMMON_EVENT_NAME.get_data_path, async() => {
|
||||
return global.lxOldDataPath
|
||||
})
|
||||
|
||||
mainHandle<LX.AppSetting>(CMMON_EVENT_NAME.get_app_setting, async() => {
|
||||
return global.lx.appSetting
|
||||
})
|
||||
|
||||
@ -19,12 +19,31 @@ import { onMounted } from '@common/utils/vueTools'
|
||||
// import BubbleCursor from '@common/utils/effects/cursor-effects/bubbleCursor'
|
||||
// import '@common/utils/effects/snow.min'
|
||||
import useApp from '@renderer/core/useApp'
|
||||
import { getDataPath } from '@renderer/utils/ipc'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
function loadCss(path) {
|
||||
const head = document.getElementsByTagName('head')[0]
|
||||
const link = document.createElement('link')
|
||||
link.type = 'text/css'
|
||||
link.rel = 'stylesheet'
|
||||
link.href = path
|
||||
head.appendChild(link)
|
||||
}
|
||||
|
||||
useApp()
|
||||
|
||||
onMounted(() => {
|
||||
document.getElementById('root').style.display = 'block'
|
||||
|
||||
getDataPath().then(value => {
|
||||
console.log(value)
|
||||
// 判断目录下是否有style.css
|
||||
if (fs.existsSync(path.join(value + '/style.css'))) {
|
||||
loadCss(path.join(value + '/style.css'))
|
||||
console.log('Load style.css')
|
||||
}
|
||||
})
|
||||
// const styles = getComputedStyle(document.documentElement)
|
||||
// window.lxData.bubbleCursor = new BubbleCursor({
|
||||
// fillStyle: styles.getPropertyValue('--color-primary-alpha-900'),
|
||||
|
||||
@ -7,6 +7,10 @@ import { APP_EVENT_NAMES, DATA_KEYS, DEFAULT_SETTING } from '@common/constants'
|
||||
|
||||
type RemoveListener = () => void
|
||||
|
||||
export const getDataPath = async() => {
|
||||
return rendererInvoke(CMMON_EVENT_NAME.get_data_path)
|
||||
}
|
||||
|
||||
export const getSetting = async() => {
|
||||
return rendererInvoke<LX.AppSetting>(CMMON_EVENT_NAME.get_app_setting)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user