更新若干代码
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<div class="location-item">
|
||||
<a href="/">首页</a>
|
||||
<span>></span>
|
||||
<a href="/index/article/index" id="cateLink"></a>
|
||||
<a href="/index/articles/index" id="cateLink"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -461,7 +461,7 @@
|
||||
const prevArticle = document.getElementById('prevArticle');
|
||||
if (data.prevArticle) {
|
||||
prevArticle.innerHTML = `
|
||||
<a href="/index/article/detail?id=${data.prevArticle.id}">
|
||||
<a href="/index/articles/detail?id=${data.prevArticle.id}">
|
||||
<i class="fa fa-arrow-left"></i> 上一篇:${data.prevArticle.title}
|
||||
</a>
|
||||
`;
|
||||
@@ -473,7 +473,7 @@
|
||||
const nextArticle = document.getElementById('nextArticle');
|
||||
if (data.nextArticle) {
|
||||
nextArticle.innerHTML = `
|
||||
<a href="/index/article/detail?id=${data.nextArticle.id}">
|
||||
<a href="/index/articles/detail?id=${data.nextArticle.id}">
|
||||
下一篇:${data.nextArticle.title} <i class="fa fa-arrow-right"></i>
|
||||
</a>
|
||||
`;
|
||||
@@ -486,7 +486,7 @@
|
||||
if (data.relatedArticles && data.relatedArticles.length > 0) {
|
||||
relatedArticles.innerHTML = data.relatedArticles.map(article => `
|
||||
<div class="related-item">
|
||||
<a href="/index/article/detail?id=${article.id}">
|
||||
<a href="/index/articles/detail?id=${article.id}">
|
||||
<div class="related-image">
|
||||
<img src="${article.image}" alt="${article.title}">
|
||||
</div>
|
||||
@@ -512,7 +512,7 @@
|
||||
}
|
||||
|
||||
// 获取文章详情
|
||||
fetch(`/index/article/detail?id=${articleId}`, {
|
||||
fetch(`/index/articles/detail?id=${articleId}`, {
|
||||
headers: {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
@@ -546,7 +546,7 @@
|
||||
const likeBtn = document.querySelector('.like-btn');
|
||||
if (likeBtn) {
|
||||
likeBtn.addEventListener('click', function() {
|
||||
fetch('/index/article/like?id=' + articleId, {
|
||||
fetch('/index/articles/like?id=' + articleId, {
|
||||
method: 'POST'
|
||||
})
|
||||
.then(response => response.json())
|
||||
@@ -590,7 +590,7 @@
|
||||
|
||||
// 更新文章访问次数
|
||||
function updateArticleViews(articleId) {
|
||||
fetch('/index/article/updateViews', {
|
||||
fetch('/index/articles/updateViews', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
Reference in New Issue
Block a user