const { BrowserWindow } = require('electron') const path = require('path') exports.MainWindow = null exports.createMainWindow = function () { // Create the browser window. // console.log(path.join(__dirname, 'web/main.js')) exports.MainWindow = new BrowserWindow({ width: 500, height: 800, resizable: false, // closable:false, webPreferences: { preload: path.join(__dirname, 'web/main.js') } }) // and load the index.html of the app. exports.MainWindow.loadURL('http://oa.ouxuan.net/?d=we&m=login') exports.MainWindow.on('minimize', function (event) { event.preventDefault(); exports.MainWindow.hide(); }); exports.MainWindow.isClose = true; exports.MainWindow.on("close", function (event) { if (!exports.MainWindow.isClose) { event.preventDefault(); exports.MainWindow.hide(); } }) }