diff --git a/android/app/build.gradle b/android/app/build.gradle index f311b66..67132d2 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -8,7 +8,7 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 - versionName "1.0" + versionName "1.0.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. diff --git a/src/composables/useAppUpdate.ts b/src/composables/useAppUpdate.ts index 0de1168..7564f95 100644 --- a/src/composables/useAppUpdate.ts +++ b/src/composables/useAppUpdate.ts @@ -15,6 +15,7 @@ export const AUTO_UPDATE_KEY = "app.autoUpdate"; export function useAppUpdate() { const supported = Capacitor.isNativePlatform(); const currentVersion = ref(""); + const nativeVersion = ref(""); const latest = ref(null); const checking = ref(false); const downloading = ref(false); @@ -22,7 +23,7 @@ export function useAppUpdate() { const ready = ref(null); const error = ref(""); - /** 读取当前运行的 Web 包版本,内置包为 builtin */ + /** 读取当前运行的 Web 包版本与原生壳版本 */ async function loadCurrent(): Promise { if (!supported) { return; @@ -30,8 +31,10 @@ export function useAppUpdate() { try { const result = await CapacitorUpdater.current(); currentVersion.value = result.bundle?.version ?? "builtin"; + nativeVersion.value = result.native ?? ""; } catch { currentVersion.value = ""; + nativeVersion.value = ""; } } @@ -111,6 +114,7 @@ export function useAppUpdate() { return { supported, currentVersion, + nativeVersion, latest, checking, downloading, diff --git a/src/pages/setting/AppSettings.vue b/src/pages/setting/AppSettings.vue index a02d663..cfaffac 100644 --- a/src/pages/setting/AppSettings.vue +++ b/src/pages/setting/AppSettings.vue @@ -48,7 +48,8 @@ - + +