fix: 解决提交作业重复提交问题

This commit is contained in:
caozc
2023-02-28 16:34:54 +08:00
parent eb9db87833
commit f59d79454c
2 changed files with 17 additions and 4 deletions

View File

@@ -321,10 +321,10 @@ const postAdd = () => {
return ElMessage.warning("评论标题为空");
}
loading.value = ElLoading.service({
lock: true,
text: "Loading",
background: "rgba(0, 0, 0, 0.7)",
});
lock: true,
text: "Loading",
background: "rgba(0, 0, 0, 0.7)",
});
console.log('用户信息', userInfo.value)
let obj = {
"collectionNum": 0,

View File

@@ -456,8 +456,10 @@ import FileTypeImg from "@/components/FileTypeImg.vue";
import { useRoute } from "vue-router/dist/vue-router";
import { ElMessage } from "element-plus";
import {useTaskPage} from "@/api/useCommon";
import {ElLoading} from "element-plus";
//import AlertSuccess from "@/components/alert/AlertSuccess.vue";
const loading = ref(false);
const fileList = ref([]);
const fielPath = ref(import.meta.env.VITE_FILE_PATH);
const uploadRef = ref();
@@ -530,6 +532,12 @@ const handleClick = () => {
return ElMessage.warning("请输入作业内容");
}
}
loading.value = ElLoading.service({
lock: true,
text: "Loading",
background: "rgba(0, 0, 0, 0.7)",
});
request(TASK_WORK_COMMIT, {
projectOrRouterLogo: type,
workUploadContent: sbValue.value.content,
@@ -545,6 +553,11 @@ const handleClick = () => {
fileList.value = [];
remove(0);
clearFiles();
loading.value.close();
}).catch(err=>{
console.log(err)
ElMessage.error("提交失败");
loading.value.close()
});
};