diff --git a/src/composables/usePlayState.js b/src/composables/usePlayState.js
index 580b3d5..46e0576 100644
--- a/src/composables/usePlayState.js
+++ b/src/composables/usePlayState.js
@@ -37,7 +37,9 @@ export function usePlayState() {
machineId: null,
qrCreatedAt: null,
qrExpireAt: null,
- qrDelayTimeoutId: null
+ qrDelayTimeoutId: null,
+ completedAt: null,
+ isCompletedExpired: false
})
const initializePage = async () => {
@@ -148,6 +150,25 @@ export function usePlayState() {
state.status = 'COMPLETED'
+ // 保存完成时间戳
+ if (gameData.completedAt) {
+ state.completedAt = gameData.completedAt
+
+ // 判断是否超过24小时
+ const now = Math.floor(Date.now() / 1000) // 当前时间戳(秒)
+ const completedTime = gameData.completedAt
+ const hoursPassed = (now - completedTime) / 3600 // 转换为小时
+
+ state.isCompletedExpired = hoursPassed > 24
+
+ console.log('完成时间判断:', {
+ completedAt: completedTime,
+ now: now,
+ hoursPassed: hoursPassed.toFixed(2),
+ isExpired: state.isCompletedExpired
+ })
+ }
+
// 更新区域和机器信息
if (gameData.region) {
state.region = gameData.region
@@ -181,6 +202,8 @@ export function usePlayState() {
totalPoints: state.totalPoints,
completedPoints: state.completedPoints,
currentPoints: state.currentPoints,
+ completedAt: state.completedAt,
+ isCompletedExpired: state.isCompletedExpired,
assets: !!state.assets
})
diff --git a/src/config/links.js b/src/config/links.js
index 098fc6e..df9e260 100644
--- a/src/config/links.js
+++ b/src/config/links.js
@@ -13,7 +13,11 @@ export const LINK_CONFIG = {
// 链接地址模板
getLinkUrl: (codeNo) => {
- return `${LINK_CONFIG.BASE_URL}${LINK_CONFIG.GAME_PATH}?${LINK_CONFIG.CODE_PARAM}=${codeNo}`
+ // 生成随机参数:时间戳 + 随机字符串
+ const timestamp = Date.now()
+ const random = Math.random().toString(36).substring(2, 8)
+ const randomParam = `${timestamp}${random}`
+ return `${LINK_CONFIG.BASE_URL}${LINK_CONFIG.GAME_PATH}/${codeNo}?t=${randomParam}`
}
}
diff --git a/src/router/index.js b/src/router/index.js
index 48b6f97..d6e5ce0 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -15,7 +15,8 @@ const NotFound = () => import('@/views/NotFound.vue')
export const routes = [
{ path: '/login', name: 'Login', component: Login, meta: { public: true, title: '登录' } },
- { path: '/play', name: 'Play', component: Play, meta: { public: true, title: '上号任务' } },
+ { path: '/play/:code', name: 'Play', component: Play, meta: { public: true, title: '上号任务' } },
+ { path: '/play', name: 'PlayLegacy', component: Play, meta: { public: true, title: '上号任务' } },
{
path: '/',
component: AdminLayout,
diff --git a/src/views/Play.vue b/src/views/Play.vue
index 4fd7236..c856f29 100644
--- a/src/views/Play.vue
+++ b/src/views/Play.vue
@@ -32,7 +32,7 @@