Commit 07321532 authored by CodeFever888's avatar CodeFever888
Browse files

'page'

parent 234606f7
...@@ -9,7 +9,7 @@ function CommentList() { ...@@ -9,7 +9,7 @@ function CommentList() {
const [size, setSize] = useState(3); const [size, setSize] = useState(3);
useEffect(() => { 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(response => response.json())
.then(data => { .then(data => {
if (data && data.code === 0 && data.data && Array.isArray(data.data.comments)) { if (data && data.code === 0 && data.data && Array.isArray(data.data.comments)) {
...@@ -24,7 +24,7 @@ function CommentList() { ...@@ -24,7 +24,7 @@ function CommentList() {
}, [page]); }, [page]);
function onDelete(commentId) { 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(response => response.json())
.then(data => { .then(data => {
if (data.code === 0) { if (data.code === 0) {
......
...@@ -7,7 +7,7 @@ function CommentTest() { ...@@ -7,7 +7,7 @@ function CommentTest() {
const name = event.target.elements.name.value; const name = event.target.elements.name.value;
const content = event.target.elements.content.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', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment