feat: 后端版本迁移修改
This commit is contained in:
+5
-5
@@ -50,7 +50,7 @@ Page({
|
||||
|
||||
// Fetch categories from API
|
||||
fetchCategories() {
|
||||
request.get('/wiki-class/list').then(res => {
|
||||
request.get('/plant/wiki-class/list').then(res => {
|
||||
const list = (res && res.list) || (Array.isArray(res) ? res : []);
|
||||
this.setData({ categories: list });
|
||||
}).catch(err => {
|
||||
@@ -83,7 +83,7 @@ Page({
|
||||
params.classId = [this.data.activeCategory];
|
||||
}
|
||||
|
||||
return request.post('/wiki/page', params).then(res => {
|
||||
return request.post('/plant/wiki/page', params).then(res => {
|
||||
const data = res || {};
|
||||
const list = data.list || [];
|
||||
const total = data.total || 0;
|
||||
@@ -96,8 +96,8 @@ Page({
|
||||
aliases: item.aliases || '',
|
||||
genus: item.genus || '',
|
||||
difficulty: item.difficulty || 0,
|
||||
isHot: item.isHot === 1,
|
||||
isFavorited: item.hasStar === 1,
|
||||
isHot: item.isHot === true || item.isHot === 1,
|
||||
isFavorited: item.hasStar === 1 || item.hasStar === '1',
|
||||
image: (item.imgList && item.imgList.length > 0) ? item.imgList[0].url : '',
|
||||
classes: (item.classes || []).map(c => c.name),
|
||||
// Pass the full item for detail navigation
|
||||
@@ -140,7 +140,7 @@ Page({
|
||||
|
||||
try {
|
||||
// Attempting consistent API pattern
|
||||
await request.get('/wiki/star', { id, type });
|
||||
await request.get('/plant/wiki/star', { id, type });
|
||||
|
||||
const key = `displayedList[${index}].isFavorited`;
|
||||
this.setData({
|
||||
|
||||
Reference in New Issue
Block a user