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": "首页",