Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
liang hong
CommentPage
Commits
07321532
Commit
07321532
authored
May 09, 2025
by
CodeFever888
Browse files
'page'
parent
234606f7
Changes
2
Show whitespace changes
Inline
Side-by-side
src/CommentList.js
View file @
07321532
...
...
@@ -9,7 +9,7 @@ function CommentList() {
const
[
size
,
setSize
]
=
useState
(
3
);
useEffect
(()
=>
{
fetch
(
`http://
10.194.23.96
:8080/comment/get?page=
${
page
}
&size=
${
size
}
`
)
fetch
(
`http://
localhost
:8080/comment/get?page=
${
page
}
&size=
${
size
}
`
)
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
{
if
(
data
&&
data
.
code
===
0
&&
data
.
data
&&
Array
.
isArray
(
data
.
data
.
comments
))
{
...
...
@@ -24,7 +24,7 @@ function CommentList() {
},
[
page
]);
function
onDelete
(
commentId
)
{
fetch
(
`http://
10.194.23.96
:8080/comment/delete?id=
${
commentId
}
`
)
fetch
(
`http://
localhost
:8080/comment/delete?id=
${
commentId
}
`
)
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
{
if
(
data
.
code
===
0
)
{
...
...
src/CommentTest.js
View file @
07321532
...
...
@@ -7,7 +7,7 @@ function CommentTest() {
const
name
=
event
.
target
.
elements
.
name
.
value
;
const
content
=
event
.
target
.
elements
.
content
.
value
;
fetch
(
'
http://
10.194.23.96
:8080/comment/add
'
,
{
fetch
(
'
http://
localhost
:8080/comment/add
'
,
{
method
:
'
POST
'
,
headers
:
{
'
Content-Type
'
:
'
application/json
'
,
...
...
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