Skip to content

Let's use AI to Earn!

数据中心默认请求和抖音对数据问题

daoyian5e9758574804
diff --git a/electron/main/plat/platforms/douyin/index.ts b/electron/main/plat/platforms/douyin/index.ts
index ea8e5a96..8908f455 100644
--- a/electron/main/plat/platforms/douyin/index.ts
+++ b/electron/main/plat/platforms/douyin/index.ts
@@ -118,21 +118,24 @@ export class Douyin extends PlatformBase {
time[1],
);
if (!ret.success) throw new Error('获取三方平台数据失败');
+ console.log('@@@ret.data', ret.data)
for (const item of ret.data) {
res.push({
+ time: item.date,
fans: item.zhangfen,
read: item.bofang,
comment: item.pinglun,
like: item.dianzan,
forward: item.fenxiang,
- collect: 0, // TODO: 获取收藏数据
+ collect: 0,
+
});
}
} catch (error) {
console.log('------ getDashboard wxSph ---', error);
}
- return res;
+ return res.reverse();
}
/**
diff --git a/src/views/statistics/statistics.tsx b/src/views/statistics/statistics.tsx
index 6e9b129f..880c48bd 100644
--- a/src/views/statistics/statistics.tsx
+++ b/src/views/statistics/statistics.tsx
@@ -68,6 +68,13 @@ const Statistics = () => {
}, []);
+ useEffect(() => {
+ // 获取账户信息后立即调用 getAccountStatistics7
+ console.log('###',123)
+ getAccountStatistics7();
+
+ }, [selectedAccounts]);
+
// 初始化图表
useEffect(() => {
if (chartRef.current) {
@@ -82,8 +89,7 @@ const Statistics = () => {
useEffect(() => {
if (statisticsInfo?.list) {
setSelectedAccounts(statisticsInfo.list.map((account) => account.id));
- // 获取账户信息后立即调用 getAccountStatistics7
- getAccountStatistics7();
+
}
}, [statisticsInfo]);
@@ -302,6 +308,8 @@ const Statistics = () => {
const res: any = statisticsInfo;
const dataAll = [];
+
+
try {
// 获取到账号列表后,遍历获取每个账号的看板数据
if (res?.list && res.list.length > 0) {
@@ -327,6 +335,8 @@ const Statistics = () => {
dataAll.push(datas);
}
+ console.log('所有数据', dataAll)
+
// 所有数据获取完成后再一次性更新
setDashboardData7(dataAll);
}