feat: 优化前端布局和代理配置

refactor: 移除调试日志并优化代码结构
style: 调整响应式设计和UI细节
fix: 修复路由和导航相关的问题
This commit is contained in:
qingfeng1121
2025-12-12 17:14:04 +08:00
parent 07ce8409e1
commit ede67faafd
14 changed files with 296 additions and 128 deletions

View File

@@ -28,7 +28,7 @@
</div>
</div>
<!-- 分页区域 -->
<PaginationComponent class="pagination-container" :list="articleList" :pageSize="10" @changePage="handleCurrentDataUpdate" />
<PaginationComponent class="pagination-container" :list="articleList" :pageSize="10" @changePage="handleCurrentDataUpdate" :key="'pagination'" />
</transition-group>
<!-- 空状态 -->
<div v-if="!loading && articleList.length === 0" class="empty-state-container">
@@ -69,7 +69,7 @@ const loading = ref(false)
*/
const handleCurrentDataUpdate = (data) => {
displayedArticles.value = data
console.log('更新后的当前页数据:', data)
// console.log('更新后的当前页数据:', data)
}
// ========== 文章数据获取模块 ==========
@@ -81,7 +81,7 @@ const handleCurrentDataUpdate = (data) => {
const getArticlesByRoute = async () => {
// 检查URL参数确定获取文章的方式
const pathSegment = route.path.split('/')[2]
console.log('当前路由分段:', pathSegment)
// console.log('当前路由分段:', pathSegment)
switch (pathSegment) {
case 'aericletype':
@@ -98,7 +98,7 @@ const getArticlesByRoute = async () => {
return await articleService.getArticlesByStatus(statusData?.status)
default:
// 默认获取所有文章
console.log('获取所有文章列表')
// console.log('获取所有文章列表')
return await articleService.getAllArticles()
}
}
@@ -189,7 +189,7 @@ const fetchArticles = async () => {
console.error('获取文章列表失败:', error)
ElMessage.error('获取文章列表失败,请稍后重试')
} finally {
console.log('最终文章列表数据:', articleList.value)
// console.log('最终文章列表数据:', articleList.value)
loading.value = false
}
}
@@ -230,7 +230,7 @@ const handleArticleClick = (article) => {
*/
const handleRouteChange = () => {
fetchArticles()
console.log('路由变化,重新获取文章列表')
// console.log('路由变化,重新获取文章列表')
}
/**
@@ -414,7 +414,6 @@ watch(
/* 响应式设计 - 平板和手机 */
@media (max-width: 768px) {
.article-list-container {
padding: 0 10px;
}
.article-card {