删除缓存

This commit is contained in:
theluyuan 2020-12-07 12:09:56 +08:00
parent b5ea985420
commit 68826df6e9

View File

@ -19,16 +19,17 @@ interface Data {
class Huancun {
data: Data = {}
has(url: string){
console.log(this.data)
if(!this.data[url]){
return false;
}
console.log(new Date().getTime() - 60000 < this.data[url].time,"time")
if(this.data[url] && new Date().getTime() - 60000 < this.data[url].time){
return this.data[url]
}else {
return false
}
// console.log(this.data)
// if(!this.data[url]){
// return false;
// }
// console.log(new Date().getTime() - 60000 < this.data[url].time,"time")
// if(this.data[url] && new Date().getTime() - 60000 < this.data[url].time){
// return this.data[url]
// }else {
// return false
// }
return false;
}
save(url: string,data: any){
this.data[url] = {data,time: new Date().getTime()}