diff --git a/App.vue b/App.vue index f86a9fe..7a3252b 100644 --- a/App.vue +++ b/App.vue @@ -3,6 +3,7 @@ import { onBeforeMount } from 'vue' // #ifdef APP + import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update'; import { useSystemStore } from '@/store/system.js'; const systemStore = useSystemStore() // #endif @@ -15,6 +16,7 @@ // #ifdef APP const appInfo = uni.getAppBaseInfo() systemStore.setAppInfo(appInfo) + checkAppUpdate() // #endif uni.getNetworkType({ @@ -46,6 +48,19 @@ userStore.setUserInfo(userInfo) } }) + + // 检查更新 + function checkAppUpdate () { + // #ifdef APP + checkUpdate().then(res => { + console.log('检查更新结果:', res) + }).catch(error => { + console.log("检查更新错误:", error) + }).finally(() => { + console.log('检查更新结束') + }) + // #endif + }