Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
style: 1
牛文政dae7589a67bb
diff --git a/electron/main/plat/PlatformBase.ts b/electron/main/plat/PlatformBase.tsindex 98ab3bb8..6dc3eb43 100644--- a/electron/main/plat/PlatformBase.ts+++ b/electron/main/plat/PlatformBase.ts@@ -140,23 +140,21 @@ export abstract class PlatformBase {// pcursor?: string,// ): Promise<{// list: CommentData[];- // pageInfo: ResponsePageInfo;+ // pageInfo: ResponsePageInfo;// }>;-- /**+ /*** 获取他人作品的二级评论列表* @param account* @param dataId* @param pcursor*/- abstract getCreatorSecondCommentListByOther(- account: AccountModel,- dataId: string,- root_comment_id: string,- pcursor?: string,- ): Promise<any>;-+ abstract getCreatorSecondCommentListByOther(+ account: AccountModel,+ dataId: string,+ root_comment_id: string,+ pcursor?: string,+ ): Promise<any>;/*** 获取评论列表diff --git a/electron/main/plat/platforms/Kwai/index.ts b/electron/main/plat/platforms/Kwai/index.tsindex 55595d83..62bc729c 100644--- a/electron/main/plat/platforms/Kwai/index.ts+++ b/electron/main/plat/platforms/Kwai/index.ts@@ -270,6 +270,15 @@ export class Kwai extends PlatformBase {};}+ getCreatorSecondCommentListByOther(+ account: AccountModel,+ dataId: string,+ root_comment_id: string,+ pcursor?: string,+ ): Promise<any> {+ return new Promise((resolve, reject) => {});+ }+async createCommentByOther(account: AccountModel,dataId: string, // 作品ID@@ -296,12 +305,22 @@ export class Kwai extends PlatformBase {content: string,) {const cookie: CookiesType = JSON.parse(account.loginCookie);- const res = await kwaiPub.commentAdd(cookie, dataId, content, {});+ const res = await kwaiPub.commentAdd(cookie, content, {+ photoId: dataId,+ });console.log('------ kaishou createComment res ----', res);return false;}+ /**+ * 回复评论+ * @param account+ * @param commentId+ * @param content+ * @param option+ * @returns+ */async replyComment(account: AccountModel,commentId: string,@@ -313,12 +332,13 @@ export class Kwai extends PlatformBase {) {const cookie: CookiesType = JSON.parse(account.loginCookie);- const res = await kwaiPub.commentAdd(cookie, option.dataId!, content, {+ const res = await kwaiPub.commentAdd(cookie, content, {+ photoId: option.dataId,replyToCommentId: Number.parseInt(commentId),- replyTo: Number.parseInt(option.dataId!),+ replyTo: option.comment.authorId,});- console.log('------ kaishou createComment res ----', res);+ if (res.status !== 200 || res.data.result !== 1) return false;return false;}diff --git a/electron/main/plat/platforms/wxSph/index.ts b/electron/main/plat/platforms/wxSph/index.tsindex e8c2f7c5..42a46d28 100644--- a/electron/main/plat/platforms/wxSph/index.ts+++ b/electron/main/plat/platforms/wxSph/index.ts@@ -233,6 +233,15 @@ export class WxSph extends PlatformBase {};}+ getCreatorSecondCommentListByOther(+ account: AccountModel,+ dataId: string,+ root_comment_id: string,+ pcursor?: string,+ ): Promise<any> {+ return new Promise((resolve, reject) => {});+ }+async createCommentByOther(account: AccountModel,dataId: string, // 作品IDdiff --git a/electron/plat/Kwai/index.ts b/electron/plat/Kwai/index.tsindex 283ab031..b789df7e 100644--- a/electron/plat/Kwai/index.ts+++ b/electron/plat/Kwai/index.ts@@ -369,7 +369,7 @@ class KwaiPub {photoId: string,pcursor?: number,) {- return await this.requestApi<GetCommentListResponse>({+ const res = await this.requestApi<GetCommentListResponse>({cookie: cookies,url: `/rest/cp/creator/comment/commentList`,method: 'POST',@@ -380,6 +380,10 @@ class KwaiPub {...(pcursor ? { pcursor } : {}),},});++ console.log('----------- getCommentList --- res: ', res);++ return res;}// 获取评论的回复列表@@ -411,9 +415,9 @@ class KwaiPub {*/async commentAdd(cookie: Electron.Cookie[],- photoId: string,content: string,reply: {+ photoId?: string;replyToCommentId?: number; // 969549966791;replyTo?: number; // 798319351;},@@ -424,7 +428,6 @@ class KwaiPub {method: 'POST',body: {content,- photoId,...reply,},});diff --git a/src/views/reply/components/oneKeyReply.tsx b/src/views/reply/components/oneKeyReply.tsxindex a9ab9a0a..4b122b17 100644--- a/src/views/reply/components/oneKeyReply.tsx+++ b/src/views/reply/components/oneKeyReply.tsx@@ -49,16 +49,19 @@ const Com = forwardRef<OneKeyReplyRef>((props: any, ref) => {args: {tag: AutorReplyCommentScheduleEvent;status: -1 | 0 | 1;- data?: any;+ data?: {+ content: string;+ aiContent: string;+ };error?: any;},) {switch (args.tag) {case AutorReplyCommentScheduleEvent.Start:- setInfoText('开始评论');+ setInfoText(`开始评论:${args.data?.content || ''}`);break;case AutorReplyCommentScheduleEvent.End:- setInfoText('评论结束');+ setInfoText(`评论结束:${args.data?.aiContent || ''}`);break;case AutorReplyCommentScheduleEvent.Error:setErrorText(args.error?.message || '未知错误');