no message

This commit is contained in:
A1300399510 2024-11-28 17:06:45 +08:00
parent ebfdfca645
commit d473163a03

View File

@ -122,18 +122,18 @@ function decodeKey(encrypted, key) {
function getBaseData() { function getBaseData() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const storedTime = localStorage.getItem("dataTimestamp") // const storedTime = localStorage.getItem("dataTimestamp")
const storedData = localStorage.getItem("basicData") // const storedData = localStorage.getItem("basicData")
const currentTime = new Date().getTime() // const currentTime = new Date().getTime()
const timeDiff = currentTime - parseInt(storedTime) // const timeDiff = currentTime - parseInt(storedTime)
if (storedTime && storedData && timeDiff <= 5 * 60 * 1000) { // if (storedTime && storedData && timeDiff <= 5 * 60 * 1000) {
// 在5分钟内使用本地存储的数据 // // 在5分钟内使用本地存储的数据
const basicData = JSON.parse(storedData) // const basicData = JSON.parse(storedData)
// 处理数据 // // 处理数据
resolve(basicData) // resolve(basicData)
return // return
} // }
$ajaxget("/api/home/basicData").then(res => { $ajaxget("/api/home/basicData").then(res => {
if (res.code != 200) return if (res.code != 200) return