perf: 未登录自动跳转

This commit is contained in:
xiongxiaoyang
2025-07-12 18:26:00 +08:00
parent 972a49f1ba
commit d54eda2366
3 changed files with 30 additions and 6 deletions

View File

@ -198,7 +198,11 @@
success: function (data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
$("#likeCount"+commentId).text("("+data.data+")") $("#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); layer.alert(data.msg);
} }
@ -219,7 +223,11 @@
success: function (data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
$("#unLikeCount"+commentId).text("("+data.data+")") $("#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); layer.alert(data.msg);
} }

View File

@ -171,7 +171,11 @@
success: function (data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
$("#likeCount"+replyId).text("("+data.data+")") $("#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); layer.alert(data.msg);
} }
@ -192,7 +196,11 @@
success: function (data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
$("#unLikeCount"+replyId).text("("+data.data+")") $("#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); layer.alert(data.msg);
} }

View File

@ -389,7 +389,11 @@
success: function (data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
$("#likeCount"+commentId).text("("+data.data+")") $("#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); layer.alert(data.msg);
} }
@ -410,7 +414,11 @@
success: function (data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
$("#unLikeCount"+commentId).text("("+data.data+")") $("#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); layer.alert(data.msg);
} }