Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
style: 打包修改,把调用原任务申请改成空函数
牛文政7eb4c6d92518
diff --git a/src/views/task/articleTask.tsx b/src/views/task/articleTask.tsxindex d0296ef5..acdbff46 100644--- a/src/views/task/articleTask.tsx+++ b/src/views/task/articleTask.tsx@@ -201,24 +201,7 @@ export default function ArticleTask() {/*** 接受任务*/- async function taskApply() {- if (!selectedTask) return;-- try {- const res: any = await taskApi.taskApply<TaskVideo>(selectedTask?._id);- // 存储任务记录信息- if (res.code === 0 && res.data) {- setTaskRecord(res.data);- message.success('任务接受成功!');-- handleCompleteTask();- } else {- message.error(res.msg || '接受任务失败,请稍后再试?');- }- } catch (error) {- message.error('接受任务失败,请稍后再试');- }- }+ async function taskApply() {}/*** 完成任务diff --git a/src/views/task/components/articleInfo.tsx b/src/views/task/components/articleInfo.tsxindex 4f43ddfc..1a69d411 100644--- a/src/views/task/components/articleInfo.tsx+++ b/src/views/task/components/articleInfo.tsx@@ -50,27 +50,7 @@ const Com = forwardRef<TaskInfoRef, TaskInfoProps>((props: any, ref) => {/*** 接受任务*/- async function taskApply() {- if (!taskInfo) return;-- try {- const res: any = await taskApi.taskApply<TaskArticle>(taskInfo?._id);- if (res.code === 0 && res.data) {- setTaskRecord(res.data);- message.success('任务接受成功!');- setIsModalOpen(false);- setChooseAccountOpen(true);-- if (onTaskApplied && typeof onTaskApplied === 'function') {- onTaskApplied();- }- } else {- message.error(res.msg || '接受任务失败,请稍后再试?');- }- } catch (error) {- message.error('接受任务失败,请稍后再试');- }- }+ async function taskApply() {}/*** 完成任务diff --git a/src/views/task/components/carInfo.tsx b/src/views/task/components/carInfo.tsxindex 595d012e..d1673cde 100644--- a/src/views/task/components/carInfo.tsx+++ b/src/views/task/components/carInfo.tsx@@ -40,26 +40,7 @@ const Com = forwardRef<TaskInfoRef, TaskInfoProps>((props: any, ref) => {/*** 接受任务*/- async function taskApply() {- if (!taskInfo) return;- console.log('taskInfo', taskInfo);- try {- const res = await taskApi.taskApply(taskInfo?._id);- setTaskInfo(res as any);- setIsModalOpen(false);-- // 添加成功提示- message.success('任务接受成功,请前往我的任务查看');-- // 调用父组件传递的刷新函数- if (onTaskApplied && typeof onTaskApplied === 'function') {- onTaskApplied();- }- } catch (error) {- console.error('接受任务失败:', error);- message.error('接受任务失败,请重试');- }- }+ async function taskApply() {}const handleCancel = () => {setIsModalOpen(false);diff --git a/src/views/task/components/popInfo.tsx b/src/views/task/components/popInfo.tsxindex 3f4d3794..5912433d 100644--- a/src/views/task/components/popInfo.tsx+++ b/src/views/task/components/popInfo.tsx@@ -59,23 +59,7 @@ const Com = forwardRef<TaskInfoRef, TaskInfoProps>(/*** 接受任务*/- async function taskApply() {- if (!taskInfo) return;-- try {- const res = await taskApi.taskApply(taskInfo?._id);- setTaskInfo(res);- message.success('任务接受成功!');- setIsModalOpen(false);-- // 调用父组件传递的刷新函数- if (onTaskApplied && typeof onTaskApplied === 'function') {- onTaskApplied();- }- } catch (error) {- message.error('接受任务失败,请稍后再试');- }- }+ async function taskApply() {}const handleCancel = () => {setIsModalOpen(false);diff --git a/src/views/task/components/videoInfo.tsx b/src/views/task/components/videoInfo.tsxindex 293baf7d..634c71bc 100644--- a/src/views/task/components/videoInfo.tsx+++ b/src/views/task/components/videoInfo.tsx@@ -79,26 +79,6 @@ const Com = forwardRef<TaskInfoRef, TaskInfoProps>((props: any, ref) => {*/async function taskApply() {if (!taskInfo) return;-- try {- const res: any = await taskApi.taskApply<TaskVideo>(taskInfo?._id);- // 存储任务记录信息- if (res.code === 0 && res.data) {- setTaskRecord(res.data);- message.success('任务接受成功!');- setIsModalOpen(false);- setChooseAccountOpen(true);-- // 调用父组件传递的刷新函数- if (onTaskApplied && typeof onTaskApplied === 'function') {- onTaskApplied();- }- } else {- message.error(res.msg || '接受任务失败,请稍后再试?');- }- } catch (error) {- message.error('接受任务失败,请稍后再试');- }}/**diff --git a/src/views/task/interactionTask.tsx b/src/views/task/interactionTask.tsxindex 2d80f586..6ab94a56 100644--- a/src/views/task/interactionTask.tsx+++ b/src/views/task/interactionTask.tsx@@ -219,26 +219,7 @@ export default function InteractionTask() {/*** 接受任务*/- async function taskApply() {- // handleCompleteTask();- // return;- if (!selectedTask) return;-- try {- const res: any = await taskApi.taskApply<TaskVideo>(selectedTask?._id);- // 存储任务记录信息- if (res.code === 0 && res.data) {- setTaskRecord(res.data);- message.success('任务接受成功!');-- handleCompleteTask();- } else {- message.error(res.msg || '接受任务失败,请稍后再试?');- }- } catch (error) {- message.error('接受任务失败,请稍后再试');- }- }+ async function taskApply() {}useEffect(() => {selectedTaskRef.current = selectedTask;@@ -343,7 +324,7 @@ export default function InteractionTask() {return (<div className={styles.taskList}>- <ChooseAccountModule+ <ChooseAccountModuleopen={chooseAccountOpen}onClose={() => !downloading && setChooseAccountOpen(false)}platChooseProps={{