diff --git a/cmd/builder.json b/cmd/builder.json index 657c4a2..60b090d 100644 --- a/cmd/builder.json +++ b/cmd/builder.json @@ -9,7 +9,7 @@ "files": [ "**/*", "!frontend/", - "!run/", + "!electron/", "!logs/", "!go/", "!python/", @@ -28,7 +28,7 @@ "installerHeaderIcon": "build/icons/icon.ico", "createDesktopShortcut": true, "createStartMenuShortcut": true, - "shortcutName": "EE框架" + "shortcutName": "ee" }, "publish": [ { diff --git a/electron/controller/framework.js b/electron/controller/framework.js index 1033f8a..a92a64b 100644 --- a/electron/controller/framework.js +++ b/electron/controller/framework.js @@ -10,6 +10,7 @@ const { logger } = require('ee-core/log'); const { getConfig } = require('ee-core/config'); const { frameworkService } = require('../service/framework'); const { sqlitedbService } = require('../service/database/sqlitedb'); +const { autoUpdater } = require('../service/os/auto_updater'); /** * framework - demo @@ -241,6 +242,22 @@ class FrameworkController { return data; } + /** + * 检查是否有新版本 + */ + checkForUpdater() { + autoUpdater.checkUpdate(); + return; + } + + /** + * 下载新版本 + */ + downloadApp() { + autoUpdater.download(); + return; + } + /** * 测试接口 */ diff --git a/electron/service/os/auto_updater.js b/electron/service/os/auto_updater.js index 84135f1..7604757 100644 --- a/electron/service/os/auto_updater.js +++ b/electron/service/os/auto_updater.js @@ -11,9 +11,6 @@ const { getMainWindow, setCloseAndQuit } = require('ee-core/electron/window'); */ class AutoUpdater { - constructor() { - } - /** * 创建 */ @@ -43,7 +40,7 @@ class AutoUpdater { } const version = electronApp.getVersion(); - logger.info('[addon:autoUpdater] current version: ', version); + logger.info('[autoUpdater] current version: ', version); // 设置下载服务器地址 let server = cfg.options.url; @@ -57,7 +54,7 @@ class AutoUpdater { try { autoUpdater.setFeedURL(cfg.options); } catch (error) { - logger.error('[addon:autoUpdater] setFeedURL error : ', error); + logger.error('[autoUpdater] setFeedURL error : ', error); } autoUpdater.on('checking-for-update', () => { diff --git a/frontend/src/views/framework/updater/Index.vue b/frontend/src/views/framework/updater/Index.vue new file mode 100644 index 0000000..3917cf2 --- /dev/null +++ b/frontend/src/views/framework/updater/Index.vue @@ -0,0 +1,85 @@ + + + + \ No newline at end of file