Merge pull request 'lyc-dev' (#60) from lyc-dev into main
This commit is contained in:
commit
78e666d6c1
|
@ -4,8 +4,6 @@ import { electronApp, optimizer, is } from '@electron-toolkit/utils'
|
|||
import icon from '../../resources/icon.png?asset'
|
||||
import File from './file'
|
||||
|
||||
// const handleUpdate = require("./handleUpdate");
|
||||
|
||||
File({ app, shell, BrowserWindow, ipcMain })
|
||||
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true'
|
||||
let mainWindow, loginWindow
|
||||
|
@ -27,10 +25,13 @@ function createLoginWindow() {
|
|||
}
|
||||
})
|
||||
// handleUpdate(loginWindow,ipcMain)
|
||||
const loginURL = is.dev ? `http://localhost:5173/#/login` : join(__dirname, '../renderer/index.html')
|
||||
loginWindow.loadURL(loginURL)
|
||||
|
||||
|
||||
// const loginURL = is.dev ? `http://localhost:5173/#/login` : `file://${__dirname}/index.html/#/login`
|
||||
// loginWindow.loadURL(loginURL)
|
||||
if (is.dev && process.env['ELECTRON_RENDERER_URL']) {
|
||||
loginWindow.loadURL('http://localhost:5173/#/login')
|
||||
} else {
|
||||
loginWindow.loadFile(join(__dirname, '../renderer/index.html'), {hash: 'login'})
|
||||
}
|
||||
|
||||
loginWindow.webContents.openDevTools()
|
||||
loginWindow.once('ready-to-show', () => {
|
||||
|
@ -113,6 +114,7 @@ async function createLinkWin(data) {
|
|||
|
||||
// 初始化完成
|
||||
app.on('ready', () => {
|
||||
|
||||
// 设置应用程序用户模型标识符
|
||||
electronApp.setAppUserModelId('com.electron')
|
||||
|
||||
|
@ -170,6 +172,7 @@ app.on('ready', () => {
|
|||
})
|
||||
|
||||
createLoginWindow()
|
||||
|
||||
app.on('activate', function () {
|
||||
if (BrowserWindow.getAllWindows().length === 0) createLoginWindow()
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue