1
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user