first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
class collection {
constructor() {
header("我的收藏")
this.getlike()
this.like = JSON.parse(localStorage.getItem("like"))
this.renderlike()
}
async getlike() {
var self = this;
if (localStorage.getItem("like") == null) {
var res = await indexServe.classList();
this.like = res.like
localStorage.setItem("like", JSON.stringify(this.like))
console.log("没有数据,重新获取成功")
}
else {
this.like = JSON.parse(localStorage.getItem("like"))
console.log("有数据,获取成功")
}
}
renderlike() {
this.like.forEach(v => {
$(".content").html
(`<li>${v}</li>`)
});
}
}
new collection