Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
何 广一
intern_project_frontend
Commits
d6b74ba9
Commit
d6b74ba9
authored
Jun 23, 2025
by
IronHammer Std
Browse files
改成20s + 不再提示刷新中
parent
d7504e97
Changes
1
Show whitespace changes
Inline
Side-by-side
src/App.tsx
View file @
d6b74ba9
...
...
@@ -127,10 +127,10 @@ function App() {
// 初始加载评论
fetchComments
()
// 设置定时器,每
3
0秒获取一次评论
// 设置定时器,每
2
0秒获取一次评论
const
interval
=
setInterval
(()
=>
{
fetchComments
()
},
1
0000
)
//
1
0秒
},
2
0000
)
//
2
0秒
// 组件卸载时清除定时器
return
()
=>
{
...
...
@@ -172,7 +172,7 @@ function App() {
</
button
>
</
div
>
<
div
className
=
"comments-container"
>
{
loading
&&
<
p
>
更新中...
</
p
>
}
<
h3
>
评论列表
</
h3
>
{
!
loading
&&
error
&&
<
p
className
=
"error"
>
{
error
}
</
p
>
}
{
!
loading
&&
comments
.
length
===
0
&&
<
p
>
暂无评论
</
p
>
}
<
ul
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment