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() {
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user