You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
949 B
33 lines
949 B
|
|
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();
|
|
}
|
|
})
|
|
}
|
|
|