Sfoglia il codice sorgente

更新设置

dev_YWQ
HolyKnightIX 1 anno fa
parent
commit
458c07732b
1 ha cambiato i file con 18 aggiunte e 0 eliminazioni
  1. +18
    -0
      src/App.vue

+ 18
- 0
src/App.vue Vedi 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!");


Caricamento…
Annulla
Salva