mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-28 10:57:23 +08:00
✨ feat: 优化桌面歌词功能 添加歌词进度 优化歌词页面样式
This commit is contained in:
+8
-4
@@ -1,5 +1,6 @@
|
||||
const { BrowserWindow } = require('electron');
|
||||
const path = require('path');
|
||||
const config = require('./config');
|
||||
|
||||
let lyricWindow = null;
|
||||
|
||||
@@ -10,13 +11,16 @@ const createWin = () => {
|
||||
frame: false,
|
||||
show: false,
|
||||
transparent: true,
|
||||
hasShadow: false,
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true,
|
||||
preload: `${__dirname}/preload.js`,
|
||||
contextIsolation: false,
|
||||
webSecurity: false,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const loadLyricWindow = (ipcMain) => {
|
||||
ipcMain.on('open-lyric', () => {
|
||||
if (lyricWindow) {
|
||||
@@ -28,9 +32,9 @@ const loadLyricWindow = (ipcMain) => {
|
||||
createWin();
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
lyricWindow.webContents.openDevTools({ mode: 'detach' });
|
||||
lyricWindow.loadURL('http://localhost:4678/#/lyric');
|
||||
lyricWindow.loadURL(`http://localhost:${config.development.lyricPort}/#/lyric`);
|
||||
} else {
|
||||
const distPath = path.resolve(__dirname, '../dist');
|
||||
const distPath = path.resolve(__dirname, config.production.distPath);
|
||||
lyricWindow.loadURL(`file://${distPath}/index.html#/lyric`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user