no message
This commit is contained in:
parent
ebfdfca645
commit
d473163a03
22
js/common.js
22
js/common.js
@ -122,18 +122,18 @@ function decodeKey(encrypted, key) {
|
||||
|
||||
function getBaseData() {
|
||||
return new Promise((resolve, reject) => {
|
||||
const storedTime = localStorage.getItem("dataTimestamp")
|
||||
const storedData = localStorage.getItem("basicData")
|
||||
// const storedTime = localStorage.getItem("dataTimestamp")
|
||||
// const storedData = localStorage.getItem("basicData")
|
||||
|
||||
const currentTime = new Date().getTime()
|
||||
const timeDiff = currentTime - parseInt(storedTime)
|
||||
if (storedTime && storedData && timeDiff <= 5 * 60 * 1000) {
|
||||
// 在5分钟内,使用本地存储的数据
|
||||
const basicData = JSON.parse(storedData)
|
||||
// 处理数据
|
||||
resolve(basicData)
|
||||
return
|
||||
}
|
||||
// const currentTime = new Date().getTime()
|
||||
// const timeDiff = currentTime - parseInt(storedTime)
|
||||
// if (storedTime && storedData && timeDiff <= 5 * 60 * 1000) {
|
||||
// // 在5分钟内,使用本地存储的数据
|
||||
// const basicData = JSON.parse(storedData)
|
||||
// // 处理数据
|
||||
// resolve(basicData)
|
||||
// return
|
||||
// }
|
||||
|
||||
$ajaxget("/api/home/basicData").then(res => {
|
||||
if (res.code != 200) return
|
||||
|
Loading…
Reference in New Issue
Block a user