mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-05-14 03:52:07 +08:00
1
This commit is contained in:
20
README.md
20
README.md
@@ -20,12 +20,22 @@
|
||||
7. 自动更新
|
||||
8. 更多功能请看文档
|
||||
|
||||
## 默认UI
|
||||
## 使用场景
|
||||
|
||||
1. 常规桌面软件
|
||||

|
||||

|
||||
|
||||
2. 游戏(h5相关技术开发)
|
||||
|
||||
3. 任意网站变桌面软件
|
||||
- discuz-q论坛
|
||||

|
||||

|
||||
|
||||
4. web项目
|
||||
|
||||
- demo使用vue编写,经典三栏样式,可自定义(使用你自己的前端页面)
|
||||
|
||||

|
||||

|
||||
|
||||
## 开始使用
|
||||
|
||||
@@ -84,8 +94,6 @@
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
2. 可联系我(qq:530353222),展示你的项目。
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 46 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 46 KiB |
@@ -31,21 +31,21 @@ const config = {
|
||||
}
|
||||
},
|
||||
windowsOption: {
|
||||
width: 980,
|
||||
height: 600,
|
||||
minWidth: 800,
|
||||
minHeight: 600,
|
||||
width: 500,
|
||||
height: 900,
|
||||
// minWidth: 500,
|
||||
// minHeight: 600,
|
||||
webPreferences: {
|
||||
//webSecurity: false,
|
||||
contextIsolation: false, // 设置此项为false后,才可在渲染进程中使用electron api
|
||||
nodeIntegration: true,
|
||||
preload: path.join(__dirname, '../preload.js')
|
||||
},
|
||||
//frame: false,
|
||||
frame: true,
|
||||
//titleBarStyle: 'hidden'
|
||||
},
|
||||
egg: {
|
||||
title: 'electron-egg', // 进程的title属性标识,无需改动
|
||||
title: 'electron-egg', // 进程的title属性标识(默认你的应用名称-英文)
|
||||
env: 'prod',
|
||||
port: 7068,
|
||||
hostname: 'localhost',
|
||||
@@ -71,7 +71,11 @@ const config = {
|
||||
uploadToServer: false,
|
||||
ignoreSystemCrashHandler: true,
|
||||
compress: false
|
||||
}
|
||||
},
|
||||
remoteUrl: {
|
||||
enable: true,
|
||||
url: 'https://discuz.chat/'
|
||||
},
|
||||
}
|
||||
|
||||
exports.get = function (flag = '', env = 'prod') {
|
||||
|
||||
8
main.js
8
main.js
@@ -80,6 +80,14 @@ async function startServer (options) {
|
||||
const protocol = 'http://'
|
||||
let startRes = null
|
||||
let url = null
|
||||
const remoteConfig = electronConfig.get('remoteUrl');
|
||||
|
||||
if (remoteConfig.enable) {
|
||||
url = remoteConfig.url
|
||||
MAIN_WINDOW.loadURL(url)
|
||||
return true
|
||||
}
|
||||
|
||||
if (ENV === 'prod') {
|
||||
url = protocol + options.hostname + ':' + options.port
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "electron-egg",
|
||||
"version": "1.12.0",
|
||||
"version": "1.13.0",
|
||||
"description": "A fast, desktop software development framework",
|
||||
"main": "main.js",
|
||||
"softName": "electron-egg",
|
||||
|
||||
Reference in New Issue
Block a user