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
@@ -24,7 +24,7 @@ Page({
},
fetchTopics() {
request.get('/topic/list').then(res => {
request.get('/plant/topic/list').then(res => {
const list = res.list || [];
const topics = list.map(t => t.title);
if (topics.length > 0) {
@@ -229,8 +229,8 @@ Page({
if (images.length > 0) {
const uploadPromises = images.map(filePath => {
return request.upload(filePath).then(res => {
// Res structure: { file: { id: "...", url: "..." } }
return res && res.file ? res.file.id : null;
// Backend returns flat FileInfo: {id, url, name, ...}
return res ? res.id : null;
});
});
@@ -257,7 +257,7 @@ Page({
ossIds: ossIds
};
await request.post('/post/publish', payload);
await request.post('/plant/post/publish', payload);
wx.hideLoading();
wx.showToast({ title: '发布成功', icon: 'success' });