云·企业官网 软件版

This commit is contained in:
2025-02-11 18:22:34 +08:00
commit 34015e0384
17 changed files with 5338 additions and 0 deletions

42
main.js Normal file
View File

@@ -0,0 +1,42 @@
const { app, BrowserWindow, ipcMain } = require('electron/main')
const path = require('path')
const fs = require('fs')
const createWindow = () => {
const saveFile = (_, data) => {
console.log(data)
fs.writeFileSync("/Users/gxwebsoft/Documents/uploads/data.txt", data)
}
const readFile = (_, data) => {
console.log(data)
return fs.readFileSync("/Users/gxwebsoft/Documents/uploads/data.txt", "utf-8").toString();
}
const win = new BrowserWindow({
width: 1400,
height: 800,
autoHideMenuBar: true,
webPreferences: {
preload: path.resolve(__dirname, './preload.js'),
}
})
ipcMain.on('save-file', saveFile)
// ipcMain.handled('read-file', readFile)
// win.loadFile('./pages/index.html')
win.loadURL('https://oa.gxwebsoft.com')
}
app.whenReady().then(() => {
createWindow()
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})