summaryrefslogtreecommitdiff
path: root/layouts/_partials/posts
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-07-27 09:08:39 +0800
committerEltrac <hi@guhub.cn>2025-07-27 09:08:39 +0800
commitd8739b6108b103d6558a9a6671d28b2e57c2400a (patch)
tree5fb0503f4de024bf7b5d01fb5cde90cc8597b16d /layouts/_partials/posts
parentd3bbb210db84d9306a524e3718229a31e7ecb6d7 (diff)
chore(debug): log potential error in console
I need like function running in production to see the result. Former-commit-id: 5f55b5990618b9d5b8862c54f5e6e7dcd15241a7
Diffstat (limited to 'layouts/_partials/posts')
-rw-r--r--layouts/_partials/posts/action-menu.html7
1 files changed, 5 insertions, 2 deletions
diff --git a/layouts/_partials/posts/action-menu.html b/layouts/_partials/posts/action-menu.html
index 5d78d1ad..6fb7f4ee 100644
--- a/layouts/_partials/posts/action-menu.html
+++ b/layouts/_partials/posts/action-menu.html
@@ -56,6 +56,7 @@
// 初始化所有功能
function initializeFeatures() {
const pageId = "{{ .File.UniqueID | urlize }}";
+ console.log(pageId)
if (!pageId) return;
// 评论展开/收起功能
@@ -134,7 +135,8 @@ function initializeLikes(pageId) {
if (localStorage.getItem("liked_" + pageId)) {
setLikedState();
}
- } catch {
+ } catch(e) {
+ console.log(e);
elements.count.innerText = "❌";
}
}
@@ -152,7 +154,8 @@ function initializeLikes(pageId) {
localStorage.setItem("liked_" + pageId, "1");
elements.count.innerText = data.likes ?? 1;
setLikedState();
- } catch {
+ } catch(e) {
+ console.log(e);
alert("点赞失败,请稍后再试");
}
};