diff --git a/platform/frontend/topics.html b/platform/frontend/topics.html index 74a7162..6cf7775 100644 --- a/platform/frontend/topics.html +++ b/platform/frontend/topics.html @@ -190,7 +190,7 @@ const TopicsApp = { }, computed: { filteredTopics() { - if (!this.filterStatus) return this.topics; + if (!this.filterStatus || this.filterStatus === 'today') return this.topics; const map = { 'pending': ['pending','待处理'], 'review': ['review','待审查'], 'ready': ['ready','待发布'], 'published': ['published','已发布'] }; const allowed = map[this.filterStatus] || [this.filterStatus]; return this.topics.filter(t => allowed.includes(t.status)); @@ -235,16 +235,9 @@ const TopicsApp = { async fetchTopics() { this.loadingTable = true; try { - const params = new URLSearchParams(); - if (this.filterStatus === 'today') { - params.set('today', 'true'); - } else if (this.filterStatus) { - params.set('status', this.filterStatus); - } - const qs = params.toString(); - const data = await this.api('/api/topics' + (qs ? '?' + qs : '')); + const params = this.filterStatus === 'today' ? '?today=true' : ''; + const data = await this.api('/api/topics' + params); this.topics = data || []; - if (qs) this.$message.success(`加载 ${this.filterStatus} 选题成功`); } catch (error) { console.error('获取选题失败:', error); this.$message.error(`获取选题失败: ${error.message}`);