Skip to content

Commit 2d521f9

Browse files
committed
mod: home topic fetch behavior
1 parent 349b7f2 commit 2d521f9

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

components/home/Carousel.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ onUnmounted(() => {
130130
:key="post.path"
131131
class="w-full flex-shrink-0"
132132
>
133-
<div class="relative h-[200px] w-full sm:h-[300px]">
133+
<div class="relative h-[200px] w-full select-none sm:h-[300px]">
134134
<img
135135
:src="post.banner || '/kungalgame.webp'"
136136
:alt="post.title"
@@ -150,9 +150,7 @@ onUnmounted(() => {
150150
>
151151
<h1>{{ post.title }}</h1>
152152
</KunLink>
153-
<p
154-
class="text-default-700 line-clamp-2 text-sm select-none sm:text-base"
155-
>
153+
<p class="text-default-700 line-clamp-2 text-sm sm:text-base">
156154
{{ post.description }}
157155
</p>
158156
<KunLink

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kun-galgame-nuxt3",
3-
"version": "3.4.47",
3+
"version": "3.4.48",
44
"packageManager": "pnpm@10.4.1",
55
"private": true,
66
"scripts": {

server/api/home/topic.get.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import type { HomeTopic } from '~/types/api/home'
55
const getHomeTopics = async (page: number, limit: number) => {
66
const skip = (page - 1) * limit
77

8-
const now = new Date()
9-
const thirtyDaysAgo = new Date(now.setDate(now.getDate() - 90))
8+
const now = Date.now()
9+
const ninetyDaysAgo = now - 90 * 24 * 60 * 60 * 1000
1010

1111
const topics = await TopicModel.find({
1212
status: { $ne: 1 },
13-
created: { $gte: thirtyDaysAgo }
13+
time: { $gte: ninetyDaysAgo }
1414
})
1515
.sort({ time: -1 })
1616
.skip(skip)

0 commit comments

Comments
 (0)