云·企业官网 软件版
This commit is contained in:
5
.idea/.gitignore
generated
vendored
Normal file
5
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
3
.npmrc
Normal file
3
.npmrc
Normal file
@@ -0,0 +1,3 @@
|
||||
registry=https://registry.npmmirror.com/
|
||||
electron_mirror=https://npmmirror.com/mirrors/electron/
|
||||
electron_builder_binaries_mirror=https://registr.npmmirror.com/-/binary/electron-builder-binaries/
|
||||
BIN
icons.icns
Normal file
BIN
icons.icns
Normal file
Binary file not shown.
BIN
icons.iconset/icon_128x128.png
Normal file
BIN
icons.iconset/icon_128x128.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
BIN
icons.iconset/icon_128x128@2x.png
Normal file
BIN
icons.iconset/icon_128x128@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
icons.iconset/icon_16x16.png
Normal file
BIN
icons.iconset/icon_16x16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 867 B |
BIN
icons.iconset/icon_32x32.png
Normal file
BIN
icons.iconset/icon_32x32.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
BIN
icons.iconset/icon_64x64.png
Normal file
BIN
icons.iconset/icon_64x64.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.6 KiB |
42
main.js
Normal file
42
main.js
Normal 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()
|
||||
}
|
||||
})
|
||||
5203
package-lock.json
generated
Normal file
5203
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
43
package.json
Normal file
43
package.json
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "websoft",
|
||||
"version": "1.0.0",
|
||||
"description": "gxtyzx",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
"start": "electron .",
|
||||
"pack": "electron-builder --dir",
|
||||
"buider": "electron-builder"
|
||||
},
|
||||
"buider": {
|
||||
"appId": "top.websoft.oa",
|
||||
"productName": "网宿办公OA系统",
|
||||
"win": {
|
||||
"icon": "logo.ico",
|
||||
"target": [
|
||||
{
|
||||
"target": "nsis",
|
||||
"arch": [
|
||||
"x64"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"mac": {
|
||||
"icon": "icons.icns"
|
||||
},
|
||||
"nsis": {
|
||||
"oneClick": false,
|
||||
"perMachine": true,
|
||||
"allowToChangeInstallationDirectory": true
|
||||
}
|
||||
},
|
||||
"author": "Websoft Inc.",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron": "^34.1.1",
|
||||
"electron-builder": "^25.1.8",
|
||||
"nodemon": "^3.1.9"
|
||||
}
|
||||
}
|
||||
21
pages/index.html
Normal file
21
pages/index.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta
|
||||
http-equiv="Content-Security-Policy"
|
||||
content="default-src 'self'; script-src 'self'"
|
||||
/>
|
||||
<meta
|
||||
http-equiv="X-Content-Security-Policy"
|
||||
content="default-src 'self'; script-src 'self'"
|
||||
/>
|
||||
<title>广西体育中心</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello from Electron renderer!</h1>
|
||||
<p>👋</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
1
pages/index.js
Normal file
1
pages/index.js
Normal file
@@ -0,0 +1 @@
|
||||
console.log('index')
|
||||
14
preload.js
Normal file
14
preload.js
Normal file
@@ -0,0 +1,14 @@
|
||||
console.log('preload..')
|
||||
const {contextBridge, ipcRenderer} = require('electron')
|
||||
contextBridge.exposeInMainWorld('API', {
|
||||
getVersion: () => {
|
||||
return process.versions.electron
|
||||
},
|
||||
saveFile: (data) => {
|
||||
ipcRenderer.send('save-file', data)
|
||||
return true
|
||||
},
|
||||
readFile(option) {
|
||||
return ipcRenderer.invoke('read-file', option)
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user