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,6 +198,10 @@
success: function (data) {
if (data.code == 200) {
$("#likeCount"+commentId).text("("+data.data+")")
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
}
@ -219,6 +223,10 @@
success: function (data) {
if (data.code == 200) {
$("#unLikeCount"+commentId).text("("+data.data+")")
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
}

View File

@ -171,6 +171,10 @@
success: function (data) {
if (data.code == 200) {
$("#likeCount"+replyId).text("("+data.data+")")
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
}
@ -192,6 +196,10 @@
success: function (data) {
if (data.code == 200) {
$("#unLikeCount"+replyId).text("("+data.data+")")
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
}

View File

@ -389,6 +389,10 @@
success: function (data) {
if (data.code == 200) {
$("#likeCount"+commentId).text("("+data.data+")")
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
}
@ -410,6 +414,10 @@
success: function (data) {
if (data.code == 200) {
$("#unLikeCount"+commentId).text("("+data.data+")")
} else if (data.code == 1001) {
//未登录
location.href = '/user/login.html?originUrl=' + encodeURIComponent(location.href);
} else {
layer.alert(data.msg);
}