From d54eda2366052095f9cc574c7c263961f3777d8c Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <1179705413@qq.com> Date: Sat, 12 Jul 2025 18:26:00 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=9C=AA=E7=99=BB=E5=BD=95=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/templates/book/book_comment.html | 12 ++++++++++-- .../resources/templates/book/book_comment_reply.html | 12 ++++++++++-- .../main/resources/templates/book/book_detail.html | 12 ++++++++++-- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/novel-front/src/main/resources/templates/book/book_comment.html b/novel-front/src/main/resources/templates/book/book_comment.html index 40f7c8e..9aad11f 100644 --- a/novel-front/src/main/resources/templates/book/book_comment.html +++ b/novel-front/src/main/resources/templates/book/book_comment.html @@ -198,7 +198,11 @@ success: function (data) { if (data.code == 200) { $("#likeCount"+commentId).text("("+data.data+")") - } else { + } else if (data.code == 1001) { + //未登录 + location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href); + + } else { layer.alert(data.msg); } @@ -219,7 +223,11 @@ success: function (data) { if (data.code == 200) { $("#unLikeCount"+commentId).text("("+data.data+")") - } else { + } else if (data.code == 1001) { + //未登录 + location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href); + + } else { layer.alert(data.msg); } diff --git a/novel-front/src/main/resources/templates/book/book_comment_reply.html b/novel-front/src/main/resources/templates/book/book_comment_reply.html index 1ee4423..0774fe5 100644 --- a/novel-front/src/main/resources/templates/book/book_comment_reply.html +++ b/novel-front/src/main/resources/templates/book/book_comment_reply.html @@ -171,7 +171,11 @@ success: function (data) { if (data.code == 200) { $("#likeCount"+replyId).text("("+data.data+")") - } else { + } else if (data.code == 1001) { + //未登录 + location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href); + + } else { layer.alert(data.msg); } @@ -192,7 +196,11 @@ success: function (data) { if (data.code == 200) { $("#unLikeCount"+replyId).text("("+data.data+")") - } else { + } else if (data.code == 1001) { + //未登录 + location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href); + + } else { layer.alert(data.msg); } diff --git a/novel-front/src/main/resources/templates/book/book_detail.html b/novel-front/src/main/resources/templates/book/book_detail.html index 9e2db5a..8028f32 100644 --- a/novel-front/src/main/resources/templates/book/book_detail.html +++ b/novel-front/src/main/resources/templates/book/book_detail.html @@ -389,7 +389,11 @@ success: function (data) { if (data.code == 200) { $("#likeCount"+commentId).text("("+data.data+")") - } else { + } else if (data.code == 1001) { + //未登录 + location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href); + + } else { layer.alert(data.msg); } @@ -410,7 +414,11 @@ success: function (data) { if (data.code == 200) { $("#unLikeCount"+commentId).text("("+data.data+")") - } else { + } else if (data.code == 1001) { + //未登录 + location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href); + + } else { layer.alert(data.msg); }