Skip to content

Let's use AI to Earn!

feat: 账户信息补粉丝数量

牛文政e849633ed84b
diff --git a/electron/main/plat/index.ts b/electron/main/plat/index.ts
index 1e7ee538..b9f8bcbc 100644
--- a/electron/main/plat/index.ts
+++ b/electron/main/plat/index.ts
@@ -53,6 +53,8 @@ class PlatController {
const info = await platform.getAccountInfo({
cookies: JSON.parse(res.loginCookie),
});
+ console.log('------ info', info);
+
if (!!info) res.fansCount = info.fansCount || 0;
return res;
}
diff --git a/electron/main/plat/platforms/douyin/index.ts b/electron/main/plat/platforms/douyin/index.ts
index 2d79973b..f210d0e2 100644
--- a/electron/main/plat/platforms/douyin/index.ts
+++ b/electron/main/plat/platforms/douyin/index.ts
@@ -87,6 +87,7 @@ export class Douyin extends PlatformBase {
account: res.authorId,
avatar: res.avatar,
nickname: res.nickname,
+ fansCount: res.fansCount,
};
}
diff --git a/electron/main/reply/controller.ts b/electron/main/reply/controller.ts
index 3ce7efba..65d51ba0 100644
--- a/electron/main/reply/controller.ts
+++ b/electron/main/reply/controller.ts
@@ -11,6 +11,7 @@ import platController from '../plat';
import { WorkData } from '../plat/plat.type';
import { ReplyService } from './service';
import { kwaiPub } from '../../plat/Kwai';
+import { douyinService } from '../../plat/douyin';
@Controller()
export class ReplyController {
@@ -106,7 +107,7 @@ export class ReplyController {
}
/**
- * 作品列表
+ * 快手作品列表
*/
@Icp('ICP_TEST_KUAISHOU_WORKS_LIST')
async testKuaiShouGetWorksList(
@@ -120,4 +121,20 @@ export class ReplyController {
const res = await kwaiPub.getPhotoList(cookie);
return res;
}
+
+ /**
+ * 抖音作品列表
+ */
+ @Icp('ICP_TEST_DOUYIN_WORKS_LIST')
+ async testDouyinGetWorksList(
+ event: Electron.IpcMainInvokeEvent,
+ accountId: number,
+ ): Promise<any> {
+ const account = await this.accountService.getAccountById(accountId);
+ if (!account) return 1;
+ const cookie = JSON.parse(account.loginCookie);
+
+ const res = await douyinService.getCreatorItems(cookie);
+ return res;
+ }
}
diff --git a/electron/plat/douyin/index.ts b/electron/plat/douyin/index.ts
index 3d5541e1..2a7b98a7 100644
--- a/electron/plat/douyin/index.ts
+++ b/electron/plat/douyin/index.ts
@@ -2267,8 +2267,8 @@ export class DouyinService {
*/
async getCreatorItems(
cookie: Electron.Cookie[],
- cursor: string,
msToken: string,
+ cursor?: string,
) {
return await requestNet<DouyinCreatorListResponse>({
url: `https://creator.douyin.com/aweme/v1/creator/item/list/?cursor=${cursor}&msToken=${msToken}`,