This commit is contained in:
张成
2025-11-09 00:21:49 +08:00
parent 7a53d74e57
commit db9a4a2c83
6 changed files with 15 additions and 64 deletions

View File

@@ -36,7 +36,7 @@ const NewFollow = () => {
try {
const res = await FollowService.get_new_fans_list(1, 20);
if (res.list) {
if (res.list && res.list.length > 0) {
// 映射数据
const mappedList = res.list.map((item: any) => ({
id: item.id,
@@ -51,6 +51,9 @@ const NewFollow = () => {
}));
setFollowList(mappedList);
} else {
// 如果没有数据,设置为空数组以显示空状态
setFollowList([]);
}
} catch (e) {
Taro.showToast({
@@ -131,7 +134,7 @@ const NewFollow = () => {
try {
const res = await FollowService.get_new_fans_list(1, 20);
if (res.list) {
if (res.list && res.list.length > 0) {
const mappedList = res.list.map((item: any) => ({
id: item.id,
user_id: item.id,
@@ -145,6 +148,9 @@ const NewFollow = () => {
}));
setFollowList(mappedList);
} else {
// 如果没有数据,设置为空数组以显示空状态
setFollowList([]);
}
} catch (e) {
Taro.showToast({