feat: 后端版本迁移修改

This commit is contained in:
Blizzard
2026-05-24 01:38:28 +08:00
parent 058a575e10
commit f8d71ee800
29 changed files with 304 additions and 291 deletions
+4 -4
View File
@@ -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()
});