Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
feat: 通知
yikaJasonMic6b13b2bb5652
diff --git a/commont/UtilsEnum.ts b/commont/UtilsEnum.tsindex e6a48379..df3cd317 100644--- a/commont/UtilsEnum.ts+++ b/commont/UtilsEnum.ts@@ -1,7 +1,7 @@/** @Author: nevin* @Date: 2025-03-01 19:27:31- * @LastEditTime: 2025-03-23 18:23:09+ * @LastEditTime: 2025-03-23 19:39:34* @LastEditors: nevin* @Description: 工具枚举*/@@ -13,4 +13,5 @@ export enum SendChannelEnum {VideoPublishProgress = 'VideoPublishProgress',// 自动运行进度或状态AutoRun = 'AutoRun',+ CommentRelyProgress = 'CommentRelyProgress',}diff --git a/electron/main/reply/comment.ts b/electron/main/reply/comment.tsindex 3eda6d7b..3afc9066 100644--- a/electron/main/reply/comment.ts+++ b/electron/main/reply/comment.ts@@ -1,12 +1,12 @@/** @Author: nevin* @Date: 2025-01-21 21:12:52- * @LastEditTime: 2025-03-23 19:09:01+ * @LastEditTime: 2025-03-23 19:40:58* @LastEditors: nevin* @Description:*/// 自动任务的进度标识 开始 获取评论列表开始 获取评论列表结束 评论开始 评论结束 结束 错误-enum AutorReplyCommentScheduleEvent {+export enum AutorReplyCommentScheduleEvent {Start = 'start',GetCommentListStart = 'getCommentListStart',GetCommentListEnd = 'getCommentListEnd',diff --git a/electron/main/reply/controller.ts b/electron/main/reply/controller.tsindex 53199340..3e043a3d 100644--- a/electron/main/reply/controller.ts+++ b/electron/main/reply/controller.ts@@ -1,16 +1,19 @@/** @Author: nevin* @Date: 2025-01-20 22:02:54- * @LastEditTime: 2025-03-23 19:17:37+ * @LastEditTime: 2025-03-23 19:43:47* @LastEditors: nevin* @Description: reply Reply*/+import windowOperate from '../../util/windowOperate';import { AutoRunModel, AutoRunType } from '../../db/models/autoRun';import { AccountService } from '../account/service';import { AutoRunService } from '../autoRun/service';import { Controller, Et, Icp, Inject } from '../core/decorators';import platController from '../plat';+import { AutorReplyCommentScheduleEvent } from './comment';import { ReplyService } from './service';+import { SendChannelEnum } from '../../../commont/UtilsEnum';@Controller()export class ReplyController {@@ -101,6 +104,7 @@ export class ReplyController {}) => {console.log(e);// TODO: 推送消息+ windowOperate.sendRenderMsg(SendChannelEnum.CommentRelyProgress, 111);},);diff --git a/electron/main/reply/service.ts b/electron/main/reply/service.tsindex 4075cd1d..3e83d1ec 100644--- a/electron/main/reply/service.ts+++ b/electron/main/reply/service.ts@@ -9,6 +9,7 @@ import PQueue from 'p-queue';import { AccountModel } from '../../db/models/account';import platController from '../plat';import { toolsApi } from '../api/tools';+import { AutorReplyCommentScheduleEvent } from './comment';@Injectable()export class ReplyService {diff --git a/src/views/reply/index.tsx b/src/views/reply/index.tsxindex 60d604cd..046e6f92 100644--- a/src/views/reply/index.tsx+++ b/src/views/reply/index.tsx@@ -1,7 +1,7 @@/** @Author: nevin* @Date: 2025-02-10 22:20:15- * @LastEditTime: 2025-03-23 15:01:19+ * @LastEditTime: 2025-03-23 19:39:40* @LastEditors: nevin* @Description: 评论页面 reply*/@@ -13,13 +13,14 @@ import {icpCreateCommentList,} from '@/icp/reply';import { Avatar, Button, Card, Col, Row } from 'antd';-import { useCallback, useEffect, useRef, useState } from 'react';+import { useCallback, useRef, useState } from 'react';import AccountSidebar from '../account/components/AccountSidebar/AccountSidebar';import styles from './reply.module.scss';import Meta from 'antd/es/card/Meta';import ReplyWorks, { ReplyWorksRef } from './components/replyWorks';import ReplyComment, { ReplyCommentRef } from './components/replyComment';import AddAutoRun, { AddAutoRunRef } from './components/addAutoRun';+import { SendChannelEnum } from '@@/UtilsEnum';export default function Page() {const [wordList, setWordList] = useState<WorkData[]>([]);@@ -29,14 +30,18 @@ export default function Page() {const Ref_AddAutoRun = useRef<AddAutoRunRef>(null);const Ref_ReplyComment = useRef<ReplyCommentRef>(null);+ // 注册监听+ (() => {+ window.ipcRenderer.on(SendChannelEnum.CommentRelyProgress, (e, args) => {+ console.log('--------- e', e);+ console.log('--------- args', args);+ });+ })();+async function getCreatorList() {- if (activeAccountId === -1) {- return;- }+ if (activeAccountId === -1) return;setWordList([]);-const res = await icpCreatorList(activeAccountId);-setWordList(res.list);}