Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
feat: 类型错误修复、修复合集清空错误、视频号原创完成
gaoSir1485679e4b3b
diff --git a/electron/main/plat/PlatformBase.ts b/electron/main/plat/PlatformBase.tsindex 88c3b880..529a09e4 100644--- a/electron/main/plat/PlatformBase.ts+++ b/electron/main/plat/PlatformBase.ts@@ -109,20 +109,18 @@ export abstract class PlatformBase {pageInfo: ResponsePageInfo;}>;--- /**+ /*** 搜索作品* @param account 账户* @param pcursor 分页游标*/- abstract getsearchNodeList(- account: AccountModel,- pcursor?: string,- ): Promise<{- list: WorkData[];- pageInfo: ResponsePageInfo;- }>;+ abstract getsearchNodeList(+ account: AccountModel,+ pcursor?: string,+ ): Promise<{+ list: WorkData[];+ pageInfo: ResponsePageInfo;+ }>;/*** 获取某个作品的数据diff --git a/electron/main/plat/index.ts b/electron/main/plat/index.tsindex 0fc8ea03..1a0ef113 100644--- a/electron/main/plat/index.ts+++ b/electron/main/plat/index.ts@@ -207,7 +207,6 @@ class PlatController {return await platform.getWorkList(account, pcursor);}-/*** 获取作品列表* @param accountdiff --git a/electron/main/plat/platforms/Kwai/index.ts b/electron/main/plat/platforms/Kwai/index.tsindex a5af6aae..7d34f10e 100644--- a/electron/main/plat/platforms/Kwai/index.ts+++ b/electron/main/plat/platforms/Kwai/index.ts@@ -16,6 +16,7 @@ import {IGetTopicsParams,IGetTopicsResponse,IGetUsersParams,+ ResponsePageInfo,VideoCallbackType,WorkData,} from '../../plat.type';@@ -184,39 +185,45 @@ export class Kwai extends PlatformBase {};}-- /**+ /*** 搜索作品列表* @param pageInfo* @returns*/- async getsearchNodeList(account: AccountModel, pcursor?: string) {- const cookie: CookiesType = JSON.parse(account.loginCookie);- const res = await kwaiPub.getsearchNodeList(cookie, pcursor);- console.log('----------- getsearchNodeList --- res: ', res.data);- const photoList = res.data.data?.visionSearchPhoto.feeds || [];- console.log('----------- getsearchNodeList --- photoList: ', photoList[0]);- // const list: WorkData[] = photoList.map((v) => {- // return {- // dataId: v.photo.id,- // readCount: v.photo.viewCount,- // likeCount: v.photo.likeCount,- // commentCount: v.photo.commentCount,- // title: v.photo.caption,- // coverUrl: v.photo.coverUrl,- // };- // });-- return {- list: [],- pageInfo: {}- // {- // hasMore: !!res.data.data.result,- // count: res.data.data.totalCount || '',- // pcursor: res.data.data.pcursor + '',- // },- };- }+ async getsearchNodeList(+ account: AccountModel,+ pcursor?: string,+ ): Promise<{+ list: WorkData[];+ pageInfo: ResponsePageInfo;+ }> {+ throw '';+ // const cookie: CookiesType = JSON.parse(account.loginCookie);+ // const res = await kwaiPub.getsearchNodeList(cookie, pcursor);+ // console.log('----------- getsearchNodeList --- res: ', res.data);+ // const photoList = res.data.data?.visionSearchPhoto.feeds || [];+ // console.log('----------- getsearchNodeList --- photoList: ', photoList[0]);+ // // const list: WorkData[] = photoList.map((v) => {+ // // return {+ // // dataId: v.photo.id,+ // // readCount: v.photo.viewCount,+ // // likeCount: v.photo.likeCount,+ // // commentCount: v.photo.commentCount,+ // // title: v.photo.caption,+ // // coverUrl: v.photo.coverUrl,+ // // };+ // // });+ //+ // return {+ // list: [],+ // pageInfo: {},+ // // {+ // // hasMore: !!res.data.data.result,+ // // count: res.data.data.totalCount || '',+ // // pcursor: res.data.data.pcursor + '',+ // // },+ // };+ }/*** TODO: 未实现diff --git a/electron/main/plat/platforms/douyin/index.ts b/electron/main/plat/platforms/douyin/index.tsindex 6c4dd5bb..721fc6b9 100644--- a/electron/main/plat/platforms/douyin/index.ts+++ b/electron/main/plat/platforms/douyin/index.ts@@ -16,6 +16,7 @@ import {IGetTopicsParams,IGetTopicsResponse,IGetUsersParams,+ ResponsePageInfo,VideoCallbackType,WorkData,} from '../../plat.type';@@ -612,6 +613,16 @@ export class Douyin extends PlatformBase {}),};}++ getsearchNodeList(+ account: AccountModel,+ pcursor?: string,+ ): Promise<{+ list: WorkData[];+ pageInfo: ResponsePageInfo;+ }> {+ throw '无此方法';+ }}const douyin = new Douyin();diff --git a/electron/main/plat/platforms/wxSph/index.ts b/electron/main/plat/platforms/wxSph/index.tsindex 10a88e26..cb724f6b 100644--- a/electron/main/plat/platforms/wxSph/index.ts+++ b/electron/main/plat/platforms/wxSph/index.ts@@ -16,6 +16,7 @@ import {IGetTopicsParams,IGetTopicsResponse,IGetUsersParams,+ ResponsePageInfo,VideoCallbackType,WorkData,} from '../../plat.type';@@ -206,14 +207,16 @@ export class WxSph extends PlatformBase {});}+ const pcursorNum = +(pcursor || 0);+return {list: dataList,pageInfo: {count: res.commentCount,- hasMore: res.commentCount > res.comment.length * Number(pcursor),+ hasMore: res.commentCount > res.comment.length * pcursorNum,pcursor:- res.commentCount > res.comment.length * Number(pcursor)- ? Number(pcursor) + 1 + ''+ res.commentCount > res.comment.length * pcursorNum+ ? pcursorNum + 1 + '': '',},};@@ -442,6 +445,16 @@ export class WxSph extends PlatformBase {shoucangDyOther(account: AccountModel, pcursor?: string): Promise<any> {return new Promise((resolve, reject) => {});}++ getsearchNodeList(+ account: AccountModel,+ pcursor?: string,+ ): Promise<{+ list: WorkData[];+ pageInfo: ResponsePageInfo;+ }> {+ throw '无此方法';+ }}const wxSph = new WxSph();diff --git a/electron/main/plat/platforms/xhs/index.ts b/electron/main/plat/platforms/xhs/index.tsindex 29f0758e..66902f3e 100644--- a/electron/main/plat/platforms/xhs/index.ts+++ b/electron/main/plat/platforms/xhs/index.ts@@ -16,6 +16,7 @@ import {IGetTopicsParams,IGetTopicsResponse,IGetUsersParams,+ ResponsePageInfo,VideoCallbackType,WorkData,} from '../../plat.type';@@ -605,6 +606,16 @@ export class Xhs extends PlatformBase {});});}++ getsearchNodeList(+ account: AccountModel,+ pcursor?: string,+ ): Promise<{+ list: WorkData[];+ pageInfo: ResponsePageInfo;+ }> {+ throw '无此方法';+ }}const xhs = new Xhs();diff --git a/src/views/publish/children/imagePage/components/ImageRightSetting/components/ImageRightSettingCommon.tsx b/src/views/publish/children/imagePage/components/ImageRightSetting/components/ImageRightSettingCommon.tsxindex 0684aef9..e4159bf9 100644--- a/src/views/publish/children/imagePage/components/ImageRightSetting/components/ImageRightSettingCommon.tsx+++ b/src/views/publish/children/imagePage/components/ImageRightSetting/components/ImageRightSettingCommon.tsx@@ -352,13 +352,16 @@ export const ImgTextMixSelect = () => {onAccountChange={(account) => {updateAccounts([account]);}}+ value={imageAccountItem.pubParams.mixInfo?.value}onChange={(_, value) => {setOnePubParams({- mixInfo: {- label: (value as IMixItem).name,- value: (value as IMixItem).id,- },+ mixInfo: !value+ ? undefined+ : {+ label: (value as IMixItem).name,+ value: (value as IMixItem).id,+ },},imageAccountItem.account.id,);diff --git a/src/views/publish/children/videoPage/components/VideoPubSetModal/VideoPubSetModal.tsx b/src/views/publish/children/videoPage/components/VideoPubSetModal/VideoPubSetModal.tsxindex 605fe3c6..a8f76afd 100644--- a/src/views/publish/children/videoPage/components/VideoPubSetModal/VideoPubSetModal.tsx+++ b/src/views/publish/children/videoPage/components/VideoPubSetModal/VideoPubSetModal.tsx@@ -64,17 +64,21 @@ const PubSetModalChild = ({}: {}) => {})),);- switch (currChooseAccount?.account?.type) {- case AccountType.KWAI:- return <VideoPubSetModal_KWAI />;- case AccountType.Douyin:- return <VideoPubSetModal_DouYin />;- case AccountType.Xhs:- return <VideoPubSetModal_XSH />;- case AccountType.WxSph:- return <VideoPubSetModal_WxSph />;- }- return <></>;+ const renderedComponent = useMemo(() => {+ switch (currChooseAccount?.account?.type) {+ case AccountType.KWAI:+ return <VideoPubSetModal_KWAI />;+ case AccountType.Douyin:+ return <VideoPubSetModal_DouYin />;+ case AccountType.Xhs:+ return <VideoPubSetModal_XSH />;+ case AccountType.WxSph:+ return <VideoPubSetModal_WxSph />;+ }+ return <></>;+ }, [currChooseAccount?.account?.type]);++ return renderedComponent || <></>;};// 设置发布参数弹框diff --git a/src/views/publish/children/videoPage/components/VideoPubSetModal/children/VideoPubSetModal_DouYin.tsx b/src/views/publish/children/videoPage/components/VideoPubSetModal/children/VideoPubSetModal_DouYin.tsxindex 8f8a2de2..702005c5 100644--- a/src/views/publish/children/videoPage/components/VideoPubSetModal/children/VideoPubSetModal_DouYin.tsx+++ b/src/views/publish/children/videoPage/components/VideoPubSetModal/children/VideoPubSetModal_DouYin.tsx@@ -1,4 +1,4 @@-import React, { ForwardedRef, forwardRef, memo } from 'react';+import React, { ForwardedRef, forwardRef, memo } from "react";import {IVideoPubSetModalChildProps,IVideoPubSetModalChildRef,diff --git a/src/views/publish/children/videoPage/components/VideoPubSetModal/components/VideoPubSetModalCommon.tsx b/src/views/publish/children/videoPage/components/VideoPubSetModal/components/VideoPubSetModalCommon.tsxindex 1690e3f2..c6f04d3d 100644--- a/src/views/publish/children/videoPage/components/VideoPubSetModal/components/VideoPubSetModalCommon.tsx+++ b/src/views/publish/children/videoPage/components/VideoPubSetModal/components/VideoPubSetModalCommon.tsx@@ -211,6 +211,7 @@ export const VideoPubMixSelect = ({}: {}) => {return (<CommonMixSelectaccount={currChooseAccount.account}+ value={currChooseAccount.pubParams.mixInfo?.value}onAccountChange={(account) => {updateAccounts({accounts: [account],@@ -218,10 +219,12 @@ export const VideoPubMixSelect = ({}: {}) => {}}onChange={(_, value) => {setOnePubParams({- mixInfo: {- label: (value as IMixItem).name,- value: (value as IMixItem).id,- },+ mixInfo: !value+ ? undefined+ : {+ label: (value as IMixItem).name,+ value: (value as IMixItem).id,+ },});}}>diff --git a/src/views/replyother/index.tsx b/src/views/replyother/index.tsxindex 95d26f12..827a8978 100644--- a/src/views/replyother/index.tsx+++ b/src/views/replyother/index.tsx@@ -13,7 +13,6 @@ import {CommentData,icpCreateCommentList,getCommentSearchNotes,-} from '@/icp/replyother';import {Avatar,@@ -186,13 +185,11 @@ export default function Page() {setWordList(res.list);}--- async function getSearchListFunc(thisid:any, qe?:any) {- setPostList([])- const res = await getCommentSearchNotes(thisid,qe)- console.log('------ getSearchListFunc', res)- setPostList(res)+ async function getSearchListFunc(thisid: any, qe?: any) {+ setPostList([]);+ const res = await getCommentSearchNotes(thisid, qe);+ console.log('------ getSearchListFunc', res);+ setPostList(res as any);}async function getFwqCreatorList() {@@ -245,7 +242,7 @@ export default function Page() {/*** 获取二级评论列表*/- async function getSecondCommentList(item: any) {+ async function getSecondCommentList(item: any) {try {const res = await icpGetSecondCommentListByOther(activeAccountId,@@ -516,10 +513,10 @@ export default function Page() {if (info.type == 'xhs') {setActiveAccountId(info.id);getFwqCreatorList();- } else if(info.type == 'KWAI'){+ } else if (info.type == 'KWAI') {setActiveAccountId(info.id);getSearchListFunc(info.id);- }else{+ } else {setActiveAccountId(info.id);getCreatorList(info.id);}