From ec1b90882aaad834773ad8821d1d7b0933e09d84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Tue, 23 Apr 2024 16:23:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E8=B0=83=E6=95=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/gui/src/bridge/update/backend.js | 9 +++------ packages/gui/src/bridge/update/front.js | 4 +++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/gui/src/bridge/update/backend.js b/packages/gui/src/bridge/update/backend.js index 921162a..4e10446 100644 --- a/packages/gui/src/bridge/update/backend.js +++ b/packages/gui/src/bridge/update/backend.js @@ -78,7 +78,6 @@ function updateHandle (app, api, win, beforeQuit, quit, log) { // 检查更新 const releasesApiUrl = 'https://api.github.com/repos/docmirror/dev-sidecar/releases' async function checkForUpdatesFromGitHub () { - log.info('DevSidecar.api.config.app.skipPreRelease:', DevSidecar.api.config.get().app.skipPreRelease) request(releasesApiUrl, { headers: { 'User-Agent': 'DS/' + pkg.version } }, (error, response, body) => { try { if (error) { @@ -109,7 +108,7 @@ function updateHandle (app, api, win, beforeQuit, quit, log) { return } - log.info('github api返回的release数据:', JSON.stringify(data, null, '\t')) + // log.info('github api返回的release数据:', JSON.stringify(data, null, '\t')) // 检查更新 for (let i = 0; i < data.length; i++) { @@ -118,7 +117,7 @@ function updateHandle (app, api, win, beforeQuit, quit, log) { if (!versionData.assets || versionData.assets.length === 0) { continue // 跳过空版本,即上传过安装包 } - if (DevSidecar.api.config.app.skipPreRelease && versionData.name.indexOf('Pre-release') >= 0) { + if (DevSidecar.api.config.get().app.skipPreRelease && versionData.name.indexOf('Pre-release') >= 0) { continue // 跳过预发布版本 } @@ -134,9 +133,7 @@ function updateHandle (app, api, win, beforeQuit, quit, log) { key: 'available', value: { version: versionData.tag_name, - releaseNotes: [ - '请查看发布公告:' + versionData.html_url - ] + releaseNotes: '发布公告:' + (versionData.html_url || ('https://github.com/docmirror/dev-sidecar/releases/tag/' + versionData.tag_name)) } }) } else { diff --git a/packages/gui/src/bridge/update/front.js b/packages/gui/src/bridge/update/front.js index 1dd73f0..41e7bca 100644 --- a/packages/gui/src/bridge/update/front.js +++ b/packages/gui/src/bridge/update/front.js @@ -68,6 +68,7 @@ function install (app, api) { title: '暂不提供自动升级', cancelText: '取消', okText: '确定', + width: 420, content: h => { function openGithubUrl () { api.ipc.openExternal('https://github.com/docmirror/dev-sidecar/releases') @@ -129,10 +130,11 @@ function install (app, api) { title: '发现新版本:' + value.version, cancelText: '暂不升级', okText: '升级', + width: 710, content: h => { if (value.releaseNotes) { if (typeof value.releaseNotes === 'string') { - return