Browse Source

更新设置

dev_YWQ
HolyKnightIX 1 year ago
parent
commit
458c07732b
1 changed files with 18 additions and 0 deletions
  1. +18
    -0
      src/App.vue

+ 18
- 0
src/App.vue View File

@@ -43,6 +43,24 @@ onLaunch(() => {
});
uni.setStorageSync("userId", "114514");
const updateManager = uni.getUpdateManager();
updateManager.onUpdateReady(function (res) {
uni.showModal({
title: "更新提示",
content: "有新的版本哦,请重启小程序应用更新",
showCancel: false,
confirmText: "立刻重启",
confirmColor: "#ff4f00",
success(res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate();
}
},
});
});
});
onShow(() => {
console.log("App Show!");


Loading…
Cancel
Save