This commit is contained in:
ywyonui 2025-09-29 23:25:15 +08:00
commit f0b599c4d6
2 changed files with 23 additions and 13 deletions

View File

@ -66,8 +66,8 @@ function goByJs(js: any) {
if (globalData.rqgqtime) { if (globalData.rqgqtime) {
confirmUrl += `&rqgqtime=${globalData.rqgqtime}`; confirmUrl += `&rqgqtime=${globalData.rqgqtime}`;
} }
if (globalData.timestamp) { if (globalData.timestampqd) {
confirmUrl += `&timestamp=${globalData.timestamp}`; confirmUrl += `&timestampqd=${globalData.timestampqd}`;
} }
console.log('重定向到签到确认页面:', confirmUrl); console.log('重定向到签到确认页面:', confirmUrl);

View File

@ -215,7 +215,7 @@ const options = ref<any>({});
// //
onLoad((params) => { onLoad((params) => {
console.log('confirm.vue onLoad - 接收到的参数:', params); console.log('confirm.vue onLoad - 接收到的参数:', params);
options.value = params || {}; options.value = params ;
if (params && params.from === "login") { if (params && params.from === "login") {
options.value = getGlobal; options.value = getGlobal;
@ -293,10 +293,10 @@ const initializePage = async () => {
// //
if (options.value?.rqgqtime) { if (options.value?.rqgqtime) {
qrExpireTime.value = parseInt(options.value.rqgqtime) || 60; qrExpireTime.value = parseInt(options.value.rqgqtime) || 60;
console.log('confirm.vue initializePage - 设置qrExpireTime:', qrExpireTime.value, '秒'); console.log('confirm.vue initializePage - 从URL参数获取rqgqtime:', options.value.rqgqtime, '设置qrExpireTime:', qrExpireTime.value, '秒');
} else { } else {
qrExpireTime.value = 60; // 60 qrExpireTime.value = 60; // 60
console.log('confirm.vue initializePage - 使用默认qrExpireTime:', qrExpireTime.value, '秒'); console.log('confirm.vue initializePage - 未找到rqgqtime参数使用默认qrExpireTime:', qrExpireTime.value, '秒');
} }
// //
@ -319,26 +319,36 @@ const initializePage = async () => {
} }
// //
if (options.value?.timestamp) { console.log('confirm.vue initializePage - 开始验证时间戳options.value.timestamp:', options.value.qdtimestamp);
const qrTimestamp = parseInt(options.value.timestamp);
if (options.value.qdtimestamp) {
const qrTimestamp = parseInt(options.value.qdtimestamp);
const currentTimestamp = Date.now(); const currentTimestamp = Date.now();
const timeDiff = currentTimestamp - qrTimestamp; const timeDiff = currentTimestamp - qrTimestamp;
const maxValidTime = qrExpireTime.value * 1000; // qrExpireTime const maxValidTime = qrExpireTime.value * 1000; // qrExpireTime
//
const qrTime = new Date(qrTimestamp).toLocaleString('zh-CN');
const currentTime = new Date(currentTimestamp).toLocaleString('zh-CN');
console.log('confirm.vue initializePage - 验证二维码时间戳:', { console.log('confirm.vue initializePage - 验证二维码时间戳:', {
rawTimestamp: options.value.qdtimestamp,
qrTimestamp, qrTimestamp,
qrTime: qrTime,
currentTimestamp, currentTimestamp,
currentTime: currentTime,
timeDiff: timeDiff + '毫秒', timeDiff: timeDiff + '毫秒',
timeDiffSeconds: Math.round(timeDiff / 1000) + '秒',
maxValidTime: maxValidTime + '毫秒', maxValidTime: maxValidTime + '毫秒',
qrExpireTime: qrExpireTime.value + '秒' maxValidTimeSeconds: qrExpireTime.value + '秒'
}); });
if (timeDiff > maxValidTime) { if (timeDiff > maxValidTime) {
console.log('confirm.vue initializePage - 二维码已过期,时间差:', timeDiff, '毫秒,超过最大有效时间:', maxValidTime, '毫秒'); console.log('confirm.vue initializePage - 二维码已过期,时间差:', timeDiff, '毫秒', Math.round(timeDiff / 1000), '秒),超过最大有效时间:', maxValidTime, '毫秒', qrExpireTime.value, '秒)');
currentStep.value = 'qrExpired'; currentStep.value = 'qrExpired';
return; return;
} else { } else {
console.log('confirm.vue initializePage - 二维码未过期,时间差:', timeDiff, '毫秒,小于最大有效时间:', maxValidTime, '毫秒'); console.log('confirm.vue initializePage - 二维码未过期,时间差:', timeDiff, '毫秒', Math.round(timeDiff / 1000), '秒),小于最大有效时间:', maxValidTime, '毫秒', qrExpireTime.value, '秒)');
} }
} }