feat 查询添加版本号新字段

This commit is contained in:
Ironsp
2026-09-27 08:28:44 +08:00
parent c7694df2cc
commit 5a7d56265c
4 changed files with 9 additions and 2 deletions

1
.gitignore vendored
View File

@@ -7,6 +7,7 @@ yarn-error.log*
pnpm-debug.log* pnpm-debug.log*
lerna-debug.log* lerna-debug.log*
doc doc
vite.config.ts.timestamp-*
node_modules node_modules
.DS_Store .DS_Store

View File

@@ -8,6 +8,7 @@ export interface DeviceAuthStatus {
startDate: string startDate: string
endDate: string endDate: string
remainingDays: number remainingDays: number
latestVersionNo: string
} }
export interface ActivateDeviceResult extends ApiResult { export interface ActivateDeviceResult extends ApiResult {

View File

@@ -65,6 +65,7 @@ function normalizeAuthInfo(payload: Partial<DeviceAuthStatus> | null | undefined
startDate: payload.startDate ?? '', startDate: payload.startDate ?? '',
endDate: payload.endDate ?? '', endDate: payload.endDate ?? '',
remainingDays: Number(payload.remainingDays ?? 0), remainingDays: Number(payload.remainingDays ?? 0),
latestVersionNo: payload.latestVersionNo ?? '',
} }
} }
@@ -77,6 +78,7 @@ function createUnauthorizedInfo(): DeviceAuthStatus {
endDate: '', endDate: '',
// -1 表示无有效剩余天数,避免误触发到期提醒 // -1 表示无有效剩余天数,避免误触发到期提醒
remainingDays: -1, remainingDays: -1,
latestVersionNo: '',
} }
} }
@@ -105,6 +107,7 @@ export function useDeviceAuth(options?: { watchShow?: boolean }) {
const days = authInfo.value?.remainingDays const days = authInfo.value?.remainingDays
return days == null || Number.isNaN(Number(days)) ? null : Number(days) return days == null || Number.isNaN(Number(days)) ? null : Number(days)
}) })
const latestVersionNo = computed(() => authInfo.value?.latestVersionNo || '')
/** /**
* 从当前授权信息判断是否需到期提醒: * 从当前授权信息判断是否需到期提醒:
* storage 中 remainingDays 为 0~7(含)时弹出 * storage 中 remainingDays 为 0~7(含)时弹出
@@ -247,6 +250,7 @@ export function useDeviceAuth(options?: { watchShow?: boolean }) {
startDate: authInfo.value?.startDate ?? '', startDate: authInfo.value?.startDate ?? '',
endDate: res.endDate || authInfo.value?.endDate || '', endDate: res.endDate || authInfo.value?.endDate || '',
remainingDays: authInfo.value?.remainingDays ?? 0, remainingDays: authInfo.value?.remainingDays ?? 0,
latestVersionNo: authInfo.value?.latestVersionNo ?? '',
}) })
} }
@@ -274,6 +278,7 @@ export function useDeviceAuth(options?: { watchShow?: boolean }) {
hasActivationCode, hasActivationCode,
deviceId, deviceId,
remainingDays, remainingDays,
latestVersionNo,
loading, loading,
authReady, authReady,
expireNoticeVisible, expireNoticeVisible,

View File

@@ -16,7 +16,7 @@
"navigationBarTitleText": "Road-Roller" "navigationBarTitleText": "Road-Roller"
}, },
"pages": [ "pages": [
// GENERATED BY UNI-PAGES, PLATFORM: APP || H5 // GENERATED BY UNI-PAGES, PLATFORM: H5 || APP
{ {
"path": "pages/Ahome/index", "path": "pages/Ahome/index",
"type": "home", "type": "home",
@@ -121,7 +121,7 @@
"color": "@tabFontColor", "color": "@tabFontColor",
"selectedColor": "@tabSelectedColor", "selectedColor": "@tabSelectedColor",
"list": [ "list": [
// GENERATED BY UNI-PAGES, PLATFORM: APP || H5 // GENERATED BY UNI-PAGES, PLATFORM: H5 || APP
{ {
"pagePath": "pages/Ahome/index", "pagePath": "pages/Ahome/index",
"text": "首页", "text": "首页",