refactor: 移除收藏功能及相关代码
删除用户收藏表及相关SQL定义 移除前端收藏按钮及JavaScript逻辑 清理API中收藏相关接口 更新README文档移除收藏功能说明
This commit is contained in:
@@ -139,7 +139,7 @@ while ($row = $result->fetch_assoc()) {
|
||||
<h5 class="card-title">版本 <?php echo htmlspecialchars($version['version']); ?></h5>
|
||||
<h6 class="card-subtitle mb-2 text-muted">发布日期: <?php echo date('Y-m-d', strtotime($version['created_at'])); ?></h6>
|
||||
<p class="card-text"><?php echo nl2br(htmlspecialchars($version['changelog'])); ?></p>
|
||||
<button class="btn btn-outline-secondary mt-2" onclick="toggleFavorite(<?php echo $appId; ?>, '<?php echo addslashes(htmlspecialchars($app['name'])); ?>')">收藏</button>
|
||||
|
||||
</div>
|
||||
<div class="card-footer bg-transparent d-flex justify-content-between align-items-center">
|
||||
<?php
|
||||
@@ -193,22 +193,7 @@ $sizeText = formatFileSize($fileSize);
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<!-- 收藏功能逻辑 -->
|
||||
<script>
|
||||
function toggleFavorite(appId, appName) {
|
||||
let favorites = JSON.parse(localStorage.getItem('appFavorites')) || {};
|
||||
|
||||
if (favorites[appId]) {
|
||||
delete favorites[appId];
|
||||
alert('已取消收藏 ' + appName);
|
||||
} else {
|
||||
favorites[appId] = appName;
|
||||
alert('已收藏 ' + appName);
|
||||
}
|
||||
|
||||
localStorage.setItem('appFavorites', JSON.stringify(favorites));
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Bootstrap JS Bundle with Popper -->
|
||||
<script src="/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user