Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
feat: 视频号获取作品列表
牛文政7239d657e913
diff --git a/electron/main/reply/controller.ts b/electron/main/reply/controller.tsindex 635704f8..f83d1592 100644--- a/electron/main/reply/controller.ts+++ b/electron/main/reply/controller.ts@@ -5,6 +5,7 @@* @LastEditors: nevin* @Description: reply Reply*/+import { AccountType } from '../../../commont/AccountEnum';import { AccountService } from '../account/service';import { Controller, Icp, Inject } from '../core/decorators';import { ReplyService } from './service';@@ -18,17 +19,24 @@ export class ReplyController {private readonly accountService!: AccountService;/**- * 测试获取抖音作品列表+ * 作品列表*/@Icp('ICP_CREATOR_LIST')- async addUser(+ async getCreatorList(event: Electron.IpcMainInvokeEvent,accountId: number,): Promise<any> {const account = await this.accountService.getAccountById(accountId);if (!account) return null;- const res = await this.replyService.testGetDouyinList(account);- return res;+ if (account.type === AccountType.Douyin) {+ const res = await this.replyService.testGetDouyinList(account);+ return res;+ }++ if (account.type === AccountType.WxSph) {+ const res = await this.replyService.testGetSphCreatorList(account);+ return res;+ }}}diff --git a/electron/main/reply/service.ts b/electron/main/reply/service.tsindex 3c3dec53..8e4ab2c3 100644--- a/electron/main/reply/service.ts+++ b/electron/main/reply/service.ts@@ -7,6 +7,7 @@import { Injectable } from '../core/decorators';import { douyinService } from '../../plat/douyin/index';import { AccountModel } from '../../db/models/account';+import { shipinhaoService } from '../../plat/shipinhao';@Injectable()export class ReplyService {@@ -33,4 +34,15 @@ export class ReplyService {return 1;}++ async testGetSphCreatorList(account: AccountModel) {+ const cookie: Electron.Cookie[] = JSON.parse(account.loginCookie);++ const res = await shipinhaoService.getPostList(cookie, {+ pageNo: 1,+ pageSize: 10,+ });++ console.log('------ res ----', res);+ }}diff --git a/electron/plat/shipinhao/index.ts b/electron/plat/shipinhao/index.tsindex a42a277c..7122fe9d 100644--- a/electron/plat/shipinhao/index.ts+++ b/electron/plat/shipinhao/index.ts@@ -1328,29 +1328,34 @@ export class ShipinhaoService {*/async getPostList(cookie: Electron.Cookie[],- body: {- currentPage: 1;- forMcn: false;- needAllCommentCount: true;- onlyUnread: false;- pageSize: 10;- pluginSessionId: null;- rawKeyBuff: null;- reqScene: 7; // 固定值- scene: 7; // 固定值- timestamp: '1741697365389';- userpageType: 13;- _log_finder_id: 'v2_060000231003b20faec8c5e38b10cbd6cb06ef3cb077ad5b14a8587570bc414e95c4b7e034ea@finder';- _log_finder_uin: '';- },+ pageInfo: { pageNo: number; pageSize: number },) {- return await requestNet<WeChatVideoUserData>({+ return await requestNet<{+ errCode: 0;+ errMsg: string; // 'request successful';+ data: { list: any[]; bindInfo: any[]; totalCount: number };+ }>({url: `https://channels.weixin.qq.com/micro/interaction/cgi-bin/mmfinderassistant-bin/post/post_list?_rid=67d03155-a6da7281`,headers: {cookie: CookieToString(cookie),},method: 'POST',- body,+ body: {+ currentPage: pageInfo.pageNo,+ forMcn: false,+ needAllCommentCount: true,+ onlyUnread: false,+ pageSize: pageInfo.pageSize,+ pluginSessionId: null,+ rawKeyBuff: null,+ reqScene: 7, // 固定值+ scene: 7, // 固定值+ timestamp: '1741697365389',+ userpageType: 13,+ _log_finder_id:+ 'v2_060000231003b20faec8c5e38b10cbd6cb06ef3cb077ad5b14a8587570bc414e95c4b7e034ea@finder',+ _log_finder_uin: '',+ },});}diff --git a/src/views/reply/index.tsx b/src/views/reply/index.tsxindex a3f4c9e6..b1cbb54d 100644--- a/src/views/reply/index.tsx+++ b/src/views/reply/index.tsx@@ -9,7 +9,6 @@ import { ipcCreatorList } from '@/icp/reply';import { Button } from 'antd';import { useCallback, useState } from 'react';import AccountSidebar from '../account/components/AccountSidebar/AccountSidebar';-import { ipcDownFile } from '@/icp/tools';export default function Page() {const [activeTab, setActiveTab] = useState('car');const [activeAccountId, setActiveAccountId] = useState<number>(-1);@@ -19,14 +18,6 @@ export default function Page() {console.log('----- res', res);}- async function downFile() {- const res = await ipcDownFile(- 'https://ai-to-earn.oss-cn-beijing.aliyuncs.com/development/temp/nopath/202503/f1cffb9c-c42a-4fcc-8516-0e2c276ee2f8.mp4',- 'default_filename',- );- console.log('----- res', res);- }-return (<div><div>@@ -41,10 +32,6 @@ export default function Page() {<Button type="primary" onClick={getCreatorList}>获取列表</Button>-- <Button type="primary" onClick={downFile}>- 下载文件- </Button></div></div>);