diff --git a/packages/gui/src/bridge/update/backend.js b/packages/gui/src/bridge/update/backend.js index 4e10446..d534eef 100644 --- a/packages/gui/src/bridge/update/backend.js +++ b/packages/gui/src/bridge/update/backend.js @@ -132,7 +132,7 @@ function updateHandle (app, api, win, beforeQuit, quit, log) { win.webContents.send('update', { key: 'available', value: { - version: versionData.tag_name, + version, releaseNotes: '发布公告:' + (versionData.html_url || ('https://github.com/docmirror/dev-sidecar/releases/tag/' + versionData.tag_name)) } }) diff --git a/packages/gui/src/bridge/update/front.js b/packages/gui/src/bridge/update/front.js index 596fbba..c471b5e 100644 --- a/packages/gui/src/bridge/update/front.js +++ b/packages/gui/src/bridge/update/front.js @@ -134,7 +134,7 @@ function install (app, api) { } console.log(value) app.$confirm({ - title: '发现新版本:' + value.version, + title: '发现新版本:v' + value.version, cancelText: '暂不升级', okText: '升级', width: 710, @@ -163,24 +163,26 @@ function install (app, api) { function newUpdateIsReady (value) { updateParams.downloading = false + console.log(value) app.$confirm({ - title: `新版本(v${value.version})已准备好,是否立即升级?`, + title: `新版本(v${value.version})已准备好,是否立即升级?`, cancelText: '暂不升级', okText: '立即升级', content: h => { - console.log(value) if (value.releaseNotes) { - const notes = [] - for (const note of value.releaseNotes) { - notes.push(
  • {note}
  • ) + if (typeof value.releaseNotes === 'string') { + return
    {value.releaseNotes}
    + } else { + const notes = [] + for (const note of value.releaseNotes) { + notes.push(
  • {note}
  • ) + } + return
    更新内容:
      {notes}
    } - return
    更新内容:
      {notes}
    } }, onOk () { api.update.doUpdateNow() - }, - onCancel () { } }) } diff --git a/packages/gui/src/view/pages/index.vue b/packages/gui/src/view/pages/index.vue index 0e9d90d..de21ec5 100644 --- a/packages/gui/src/view/pages/index.vue +++ b/packages/gui/src/view/pages/index.vue @@ -171,7 +171,7 @@ export default { this.switchBtns = this.createSwitchBtns() this.$set(this, 'update', this.$global.update) if (!this.update.autoChecked && this.config.app.autoChecked) { - this.update.autoChecked = true // 应用启动时,只执行一遍 + this.update.autoChecked = true // 应用启动时,执行一次 this.doCheckUpdate(false) } this.$api.info.get().then(ret => {