From 61de8c4cf612d8fdc0f5d41195ca6e5be5028f1f Mon Sep 17 00:00:00 2001 From: dlzmoe <65840178+dlzmoe@users.noreply.github.com> Date: Wed, 6 Nov 2024 17:45:09 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix:=20=E4=BF=AE=E5=A4=8D=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Other/Signature.vue | 37 +++++++++++++++++++----------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/src/components/Other/Signature.vue b/src/components/Other/Signature.vue index 957a9f9..c2bc228 100644 --- a/src/components/Other/Signature.vue +++ b/src/components/Other/Signature.vue @@ -5,35 +5,44 @@ export default { methods: { init() { $(".signature-img").each(function () { - var self = $(this); + var self1 = $(this); // 检查是否已经处理过 - if (self.data("processed")) { - return; // 如果已经处理过,跳过当前元素 - } + // if (self1.data("processed")) { + // return; // 如果已经处理过,跳过当前元素 + // } - var url = self.attr("src"); - var img = new Image(); - img.src = url; + var url1 = self1.attr("src"); + var img1 = new Image(); + img1.src = url1; // 标记为已处理 - self.data("processed", true); + // self1.data("processed", true); // 图片不可访问 - img.onerror = function () { - if (self.siblings(".signature-p").length < 1) { - self.after( - `
${url}(该用户签名不可访问,已自动转文字)
` + img1.onerror = function () { + if (self1.siblings(".signature-p").length < 1) { + self1.after( + `${url1}(该用户签名不可访问,已自动转文字)
` ); - self.hide(); + self1.hide(); } }; }); }, }, created() { + // let pollinglength1 = 0; + let pollinglength2 = 0; setInterval(() => { - this.init(); + // if (pollinglength1 != $(".topic-list-body tr").length) { + // pollinglength1 = $(".topic-list-body tr").length; + // this.init(); + // } + if (pollinglength2 != $(".post-stream .topic-post").length) { + pollinglength2 = $(".post-stream .topic-post").length; + this.init(); + } }, 1000); }, };