diff --git a/src/components/CaseManage/CommonRecommend.vue b/src/components/CaseManage/CommonRecommend.vue index 059d9a2e..495b5612 100644 --- a/src/components/CaseManage/CommonRecommend.vue +++ b/src/components/CaseManage/CommonRecommend.vue @@ -766,7 +766,6 @@ function handleStageOk() { if (props.type === 1 && props.groupId && (props.groupMemberCount < (props.groupMemberNumber * 1 + projectSelectRows.value.length + stuSelectRows.value.length))) { return message.warning("添加小组学员超过最大值"); } - emit("finash", false); nameSearch.value.keyword = ""; caseRecommend({ launchType: 1, @@ -775,16 +774,19 @@ function handleStageOk() { pushUserIdList: stuSelectRows.value.map((stu) => stu.id), groupIds: auditSelectRows.value?.map((e) => e.id), deptIds: deptList.value?.map((e) => e.id), - }).then((res) => { - if (res?.data?.status == 200) { - message.success("推荐成功"); - emit("finash", true); - } else { - message.error("推荐失败"); + }).then(response => { + console.log(response); + if (!response.ok) { + throw new Error("Failed to load response data"); } + return response.json(); + }).then(() => { + message.success("推荐成功"); + emit("finash", true); deleteDepSelect(); clear() }).catch(() => { + deleteDepSelect(); clear() message.error("推荐失败"); })