修改功能,现已测试注册登录忘记密码
This commit is contained in:
@@ -101,6 +101,17 @@
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="cxz-recommend-section">
|
||||
<div class="cxz-recommend-card">
|
||||
<div class="cxz-recommend-title">相关推荐</div>
|
||||
<ul class="cxz-recommend-list" id="freeRelatedList"></ul>
|
||||
</div>
|
||||
<div class="cxz-recommend-card">
|
||||
<div class="cxz-recommend-title">最新文章</div>
|
||||
<ul class="cxz-recommend-list" id="freeLatestList"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Comment Section -->
|
||||
<div class="cxz-comment-section">
|
||||
<div class="cxz-comment-header">
|
||||
@@ -356,8 +367,47 @@
|
||||
if (!prev && rows[0]) prev = rows[0];
|
||||
if (!next && rows[1]) next = rows[1];
|
||||
if (prev || next) renderArticleNav(prev, next);
|
||||
renderFreeArticleList("#freeRelatedList", rows.filter(function (item) {
|
||||
var id = item && (item.id || item.articleId || item.freeArticleId);
|
||||
return id && String(id) !== String(articleId);
|
||||
}).slice(0, 8));
|
||||
})
|
||||
.catch(function () {});
|
||||
loadFreeArticleLatest();
|
||||
}
|
||||
|
||||
function loadFreeArticleLatest() {
|
||||
ApiClient.get(ApiClient.API.freeArticleLatest, { articleCount: 8 })
|
||||
.then(function (res) {
|
||||
if (!ApiClient.isSuccess(res)) return;
|
||||
renderFreeArticleList("#freeLatestList", ApiClient.asArray(ApiClient.pickData(res, [])));
|
||||
})
|
||||
.catch(function () {
|
||||
renderFreeArticleList("#freeLatestList", []);
|
||||
});
|
||||
}
|
||||
|
||||
function renderFreeArticleList(selector, list) {
|
||||
var $list = $(selector).empty();
|
||||
if (!list || !list.length) {
|
||||
$list.html('<li class="cxz-recommend-empty">暂无文章</li>');
|
||||
return;
|
||||
}
|
||||
$.each(list, function (_, item) {
|
||||
var id = item.id || item.articleId || item.freeArticleId;
|
||||
if (!id) return;
|
||||
var title = item.title || item.articleTitle || item.name || "无标题";
|
||||
var time = DateUtil.formatDateToYMD(item.updateTime || item.createTime || item.publishTime) || "";
|
||||
$list.append(
|
||||
'<li><a href="' +
|
||||
escapeHtml(articleLinkOf(item)) +
|
||||
'">' +
|
||||
escapeHtml(title) +
|
||||
'</a><span>' +
|
||||
escapeHtml(time) +
|
||||
"</span></li>",
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function updateLikeButton(data) {
|
||||
|
||||
Reference in New Issue
Block a user