feat: 后端版本迁移修改
This commit is contained in:
@@ -69,7 +69,7 @@ Page({
|
||||
|
||||
try {
|
||||
// Correct API Endpoint and Params
|
||||
const res = await request.post('/post/page', { current, pageSize, hasReviewed: 1 });
|
||||
const res = await request.post('/plant/post/page', { current, pageSize, hasReviewed: 1 });
|
||||
|
||||
// Handle response structure: { code: 200, data: { list: [], ... } }
|
||||
// OR if request.js unwraps it: { list: [], ... }
|
||||
@@ -183,7 +183,7 @@ Page({
|
||||
const type = post.likedByMe ? 2 : 1;
|
||||
|
||||
try {
|
||||
await request.get('/post/like', { id: postId, type });
|
||||
await request.get('/plant/post/like', { id: postId, type });
|
||||
|
||||
// Optimistic Update
|
||||
const updatedPosts = this.data.posts.map(p => {
|
||||
@@ -225,7 +225,7 @@ Page({
|
||||
const type = post.isFavorited ? 2 : 1; // 1: Collect, 2: Cancel
|
||||
|
||||
try {
|
||||
await request.get('/post/star', { id: postId, type });
|
||||
await request.get('/plant/post/star', { id: postId, type });
|
||||
|
||||
// Optimistic Update
|
||||
const updatedPosts = this.data.posts.map(p => {
|
||||
@@ -283,7 +283,7 @@ Page({
|
||||
}
|
||||
|
||||
try {
|
||||
await request.post('/post/comment', {
|
||||
await request.post('/plant/post/comment', {
|
||||
postId: commentingPostId,
|
||||
content: commentText.trim()
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user