diff --git a/templates/MetaLab-2026/html/posts/show.html b/templates/MetaLab-2026/html/posts/show.html index 4ae8560..36e6262 100644 --- a/templates/MetaLab-2026/html/posts/show.html +++ b/templates/MetaLab-2026/html/posts/show.html @@ -126,7 +126,7 @@ {{else}}
- 登录 后参与评论 + 登录 后参与评论
{{end}} @@ -324,7 +324,7 @@ headers: { 'Content-Type': 'application/json', 'X-CSRF-Token': csrfToken } }) .then(function(r) { - if (r.status === 401) { window.location.href = '/login?redirect=/posts/' + postId; return null; } + if (r.status === 401) { window.location.href = '/auth/login?redirect=/posts/' + postId; return null; } return r.json(); }) .then(function(d) { @@ -346,7 +346,7 @@ headers: { 'Content-Type': 'application/json', 'X-CSRF-Token': csrfToken } }) .then(function(r) { - if (r.status === 401) { window.location.href = '/login?redirect=/posts/' + postId; return null; } + if (r.status === 401) { window.location.href = '/auth/login?redirect=/posts/' + postId; return null; } return r.json(); }) .then(function(d) { @@ -388,7 +388,7 @@ if (csrfToken) opts.headers['X-CSRF-Token'] = csrfToken; if (data) opts.body = JSON.stringify(data); return fetch(url, opts).then(function(r) { - if (r.status === 401) { window.location.href = '/login?redirect=/posts/' + postId; throw new Error('unauthorized'); } + if (r.status === 401) { window.location.href = '/auth/login?redirect=/posts/' + postId; throw new Error('unauthorized'); } return r.json(); }); } @@ -470,7 +470,7 @@ // 无弹窗回退(未登录跳转) function handleNoModal() { if (!csrfToken) { - window.location.href = '/login?redirect=/posts/' + postId; + window.location.href = '/auth/login?redirect=/posts/' + postId; return; } // 无弹窗兜底:直接 toggle @@ -571,7 +571,7 @@ // 事件:点击收藏按钮 → 打开弹窗 favBtn.addEventListener('click', function() { - if (!csrfToken) { window.location.href = '/login?redirect=/posts/' + postId; return; } + if (!csrfToken) { window.location.href = '/auth/login?redirect=/posts/' + postId; return; } showModal(); });