feat: 后端版本迁移修改
This commit is contained in:
@@ -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' });
|
||||
|
||||
Reference in New Issue
Block a user