删除缓存

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

View File

@ -19,17 +19,18 @@ interface Data {
class Huancun { class Huancun {
data: Data = {} data: Data = {}
has(url: string){ has(url: string){
console.log(this.data) // console.log(this.data)
if(!this.data[url]){ // 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; 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
}
}
save(url: string,data: any){ save(url: string,data: any){
this.data[url] = {data,time: new Date().getTime()} this.data[url] = {data,time: new Date().getTime()}
} }