mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-05-14 11:52:07 +08:00
Merge branch 'master' into ee_dev
This commit is contained in:
21
README.md
21
README.md
@@ -2,7 +2,7 @@
|
||||
[](https://gitee.com/wallace5303/electron-egg/stargazers)
|
||||
|
||||
<div align=center>
|
||||
<img src="https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/logo.png" width="200" height="200" />
|
||||
<img src="https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/logo.png" width="150" height="150" />
|
||||
</div>
|
||||
|
||||
一个入门简单、跨平台的桌面软件开发框架。
|
||||
@@ -20,28 +20,33 @@
|
||||
|
||||
## 特性
|
||||
1. 跨平台:一套代码,可以打包成windows版、Mac版、Linux版
|
||||
2. 简单高效:只需学习js语言,同时支持vue、react、ejs等前端技术
|
||||
2. 简单高效:只需学习 js 语言,同时支持vue、react、ejs等前端技术
|
||||
3. 前端独立:理论上支持任何前端技术,编写出精美的UI效果
|
||||
4. 工程化:可以用服务端的开发思维,来编写桌面软件
|
||||
5. 高性能:事件驱动、非阻塞式IO
|
||||
6. 功能丰富:服务端的技术场景等
|
||||
6. 功能丰富:前端、服务端的技术场景等
|
||||
7. 功能demo:桌面软件常见功能,后续逐步集成或提供demo
|
||||
8. 更多功能请看文档
|
||||
|
||||
## 使用场景
|
||||
|
||||
### 1. 常规桌面软件
|
||||
- demo
|
||||
- windows平台
|
||||
|
||||

|
||||

|
||||
|
||||
- macOS平台
|
||||

|
||||
|
||||
- linux平台 (ubuntu)
|
||||

|
||||
|
||||
### 2. vue、react、angular、web 转换成桌面软件
|
||||
- vue-ant-design(本地)
|
||||
|
||||

|
||||
|
||||
- Youtube(远程网站)
|
||||
- Youtube(web项目地址)
|
||||
|
||||

|
||||
|
||||
@@ -53,9 +58,11 @@
|
||||
|
||||
## 开始使用
|
||||
|
||||
1. [安装文档](https://www.yuque.com/u34495/mivcfg/qo4uqg)
|
||||
- [安装文档](https://www.yuque.com/u34495/mivcfg/qo4uqg)
|
||||
|
||||
## 项目案例
|
||||
|
||||
- [查看](https://www.yuque.com/u34495/mivcfg/ep4otg)
|
||||
|
||||
## 交流
|
||||
1. qq群:735532437
|
||||
|
||||
@@ -14,7 +14,7 @@ module.exports = {
|
||||
* 安装
|
||||
*/
|
||||
install (eeApp) {
|
||||
console.log('[preload] load AutoUpdater module');
|
||||
eeApp.logger.info('[preload] load AutoUpdater module');
|
||||
|
||||
const status = {
|
||||
error: -1,
|
||||
@@ -27,13 +27,13 @@ module.exports = {
|
||||
const updateConfig = eeApp.config.autoUpdate;
|
||||
const mainWindow = eeApp.electron.mainWindow;
|
||||
const version = app.getVersion();
|
||||
console.log('[preload:autoUpdater] current version: ', version);
|
||||
eeApp.logger.info('[preload:autoUpdater] current version: ', version);
|
||||
|
||||
// 设置下载服务器地址
|
||||
let server = updateConfig.options.url;
|
||||
let lastChar = server.substring(server.length - 1);
|
||||
server = lastChar === '/' ? server : server + "/";
|
||||
console.log('[preload:autoUpdater] server: ', server);
|
||||
eeApp.logger.info('[preload:autoUpdater] server: ', server);
|
||||
updateConfig.options.url = server;
|
||||
|
||||
// 是否后台自动下载
|
||||
@@ -82,6 +82,7 @@ module.exports = {
|
||||
totalSize: totalSize,
|
||||
transferredSize: transferredSize
|
||||
}
|
||||
eeApp.logger.info('[preload:download-progress] progress: ', text);
|
||||
sendStatusToWindow(mainWindow, info);
|
||||
})
|
||||
autoUpdater.on('update-downloaded', (info) => {
|
||||
@@ -110,7 +111,6 @@ module.exports = {
|
||||
autoUpdater.downloadUpdate();
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -118,7 +118,6 @@ module.exports = {
|
||||
*/
|
||||
function sendStatusToWindow(mainWindow, content = {}) {
|
||||
const textJson = JSON.stringify(content);
|
||||
eLogger.info(textJson);
|
||||
const channel = 'app.updater';
|
||||
mainWindow.webContents.send(channel, textJson);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ module.exports = {
|
||||
* 安装
|
||||
*/
|
||||
install (eeApp) {
|
||||
console.log('[preload] load awaken module');
|
||||
eeApp.logger.info('[preload] load awaken module');
|
||||
const protocolInfo = eeApp.config.awakeProtocol;
|
||||
const PROTOCOL = protocolInfo.protocol;
|
||||
|
||||
@@ -49,7 +49,7 @@ module.exports = {
|
||||
urlPath: pathname,
|
||||
urlParams: search && search.slice(1)
|
||||
}
|
||||
console.log('[awaken] [handleUrl] awakeUrlInfo:', awakeUrlInfo);
|
||||
eeApp.logger.info('[awaken] [handleUrl] awakeUrlInfo:', awakeUrlInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ module.exports = {
|
||||
* 安装
|
||||
*/
|
||||
install (eeApp) {
|
||||
console.log('[preload] load security module');
|
||||
eeApp.logger.info('[preload] load security module');
|
||||
const runWithDebug = process.argv.find(function(e){
|
||||
let isHasDebug = e.includes("--inspect") || e.includes("--inspect-brk") || e.includes("--remote-debugging-port");
|
||||
return isHasDebug;
|
||||
@@ -18,7 +18,7 @@ module.exports = {
|
||||
|
||||
// 不允许远程调试
|
||||
if (runWithDebug) {
|
||||
console.log('[error] Remote debugging is not allowed, runWithDebug:', runWithDebug);
|
||||
eeApp.logger.error('[error] Remote debugging is not allowed, runWithDebug:', runWithDebug);
|
||||
eeApp.appQuit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ module.exports = {
|
||||
* 安装
|
||||
*/
|
||||
install (eeApp) {
|
||||
console.log('[preload] load tray module');
|
||||
eeApp.logger.info('[preload] load tray module');
|
||||
const trayConfig = eeApp.config.tray;
|
||||
const mainWindow = eeApp.electron.mainWindow;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ const awaken = require('../library/awaken');
|
||||
module.exports = async (app) => {
|
||||
|
||||
//已实现的功能模块,可选择性使用和修改
|
||||
|
||||
|
||||
tray.install(app);
|
||||
|
||||
security.install(app);
|
||||
@@ -33,7 +33,7 @@ function loadUpdate (app) {
|
||||
const config = app.config.autoUpdate;
|
||||
if ( (is.windows() && config.windows) || (is.macOS() && config.macOS) || (is.linux() && config.linux) ) {
|
||||
const autoUpdater = require('../library/autoUpdater');
|
||||
autoUpdater.install();
|
||||
autoUpdater.install(app);
|
||||
|
||||
// 是否检查更新
|
||||
if (config.force) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ee",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"description": "A fast, desktop software development framework",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user