From 5a7d56265ca57c44e6e4001bfd366f10cefe2b81 Mon Sep 17 00:00:00 2001 From: Ironsp <1522278303@qq.com> Date: Sun, 27 Sep 2026 08:28:44 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E6=9F=A5=E8=AF=A2=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E6=96=B0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + src/api/device/index.ts | 1 + src/composables/useDeviceAuth.ts | 5 +++++ src/pages.json | 4 ++-- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index da39b17..275dd25 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ yarn-error.log* pnpm-debug.log* lerna-debug.log* doc +vite.config.ts.timestamp-* node_modules .DS_Store diff --git a/src/api/device/index.ts b/src/api/device/index.ts index dbb01bb..219e92e 100644 --- a/src/api/device/index.ts +++ b/src/api/device/index.ts @@ -8,6 +8,7 @@ export interface DeviceAuthStatus { startDate: string endDate: string remainingDays: number + latestVersionNo: string } export interface ActivateDeviceResult extends ApiResult { diff --git a/src/composables/useDeviceAuth.ts b/src/composables/useDeviceAuth.ts index a8a8c57..a005ac6 100644 --- a/src/composables/useDeviceAuth.ts +++ b/src/composables/useDeviceAuth.ts @@ -65,6 +65,7 @@ function normalizeAuthInfo(payload: Partial | null | undefined startDate: payload.startDate ?? '', endDate: payload.endDate ?? '', remainingDays: Number(payload.remainingDays ?? 0), + latestVersionNo: payload.latestVersionNo ?? '', } } @@ -77,6 +78,7 @@ function createUnauthorizedInfo(): DeviceAuthStatus { endDate: '', // -1 表示无有效剩余天数,避免误触发到期提醒 remainingDays: -1, + latestVersionNo: '', } } @@ -105,6 +107,7 @@ export function useDeviceAuth(options?: { watchShow?: boolean }) { const days = authInfo.value?.remainingDays return days == null || Number.isNaN(Number(days)) ? null : Number(days) }) + const latestVersionNo = computed(() => authInfo.value?.latestVersionNo || '') /** * 从当前授权信息判断是否需到期提醒: * storage 中 remainingDays 为 0~7(含)时弹出 @@ -247,6 +250,7 @@ export function useDeviceAuth(options?: { watchShow?: boolean }) { startDate: authInfo.value?.startDate ?? '', endDate: res.endDate || authInfo.value?.endDate || '', remainingDays: authInfo.value?.remainingDays ?? 0, + latestVersionNo: authInfo.value?.latestVersionNo ?? '', }) } @@ -274,6 +278,7 @@ export function useDeviceAuth(options?: { watchShow?: boolean }) { hasActivationCode, deviceId, remainingDays, + latestVersionNo, loading, authReady, expireNoticeVisible, diff --git a/src/pages.json b/src/pages.json index 0c23132..659f0ca 100644 --- a/src/pages.json +++ b/src/pages.json @@ -16,7 +16,7 @@ "navigationBarTitleText": "Road-Roller" }, "pages": [ - // GENERATED BY UNI-PAGES, PLATFORM: APP || H5 + // GENERATED BY UNI-PAGES, PLATFORM: H5 || APP { "path": "pages/Ahome/index", "type": "home", @@ -121,7 +121,7 @@ "color": "@tabFontColor", "selectedColor": "@tabSelectedColor", "list": [ - // GENERATED BY UNI-PAGES, PLATFORM: APP || H5 + // GENERATED BY UNI-PAGES, PLATFORM: H5 || APP { "pagePath": "pages/Ahome/index", "text": "首页",