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); }