diff --git a/client/src/App.vue b/client/src/App.vue index f6d878b..64167fc 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -9,6 +9,30 @@ import { onLaunch, onShow, onHide } from '@dcloudio/uni-app' onLaunch(() => { initTheme() + // #ifdef MP-WEIXIN + // 版本更新检测:新版本发布后,旧版本用户冷启动时静默下载、弹窗引导重启 + const um = uni.getUpdateManager && uni.getUpdateManager() + if (um) { + um.onUpdateReady(() => { + uni.showModal({ + title: '更新提示', + content: '新版本已经准备好,是否重启应用?', + confirmText: '立即重启', + cancelText: '稍后', + success: (m) => { + if (m.confirm) um.applyUpdate() + }, + }) + }) + um.onUpdateFailed(() => { + uni.showModal({ + title: '更新提示', + content: '新版本下载失败,请删除当前小程序后重新搜索打开', + showCancel: false, + }) + }) + } + // #endif }) onShow(() => {}) diff --git a/client/src/manifest.json b/client/src/manifest.json index de26396..76d66e8 100644 --- a/client/src/manifest.json +++ b/client/src/manifest.json @@ -1,7 +1,7 @@ { "name": "宇之然AI维度", "appid": "wxdad62baf4ccd09e3", - "versionName": "1.4.2", + "versionName": "1.4.3", "versionCode": "100", "description": "AI 知识探索社区 — 从5个维度系统理解人工智能", "uni-app": {