|
@@ -1,8 +1,8 @@
|
|
|
import { httpApp } from "@/plugins/axiosIndex";
|
|
|
import { pickBy } from "lodash-es";
|
|
|
-import { object2QueryString } from "@/utils/utils";
|
|
|
+import { getMd5FromBlob, object2QueryString } from "@/utils/utils";
|
|
|
|
|
|
-export function searchTasks({
|
|
|
+export async function searchTasks({
|
|
|
examId = "",
|
|
|
entityId = "",
|
|
|
type = "",
|
|
@@ -16,7 +16,7 @@ export function searchTasks({
|
|
|
return httpApp.post("/api/admin/task/query?" + object2QueryString(data));
|
|
|
}
|
|
|
|
|
|
-export function importPaper({
|
|
|
+export async function importPaper({
|
|
|
examId,
|
|
|
processPaper,
|
|
|
processAnswer,
|
|
@@ -26,7 +26,6 @@ export function importPaper({
|
|
|
audioPlayCount = "",
|
|
|
fileName,
|
|
|
file,
|
|
|
- md5,
|
|
|
}) {
|
|
|
const form = new FormData();
|
|
|
form.append("examId", examId);
|
|
@@ -39,31 +38,40 @@ export function importPaper({
|
|
|
form.append("fileName", fileName);
|
|
|
form.append("file", file);
|
|
|
return httpApp.post("/api/admin/exam/paper/import", form, {
|
|
|
- headers: { "Content-Type": "multipart/form-data", md5 },
|
|
|
+ headers: {
|
|
|
+ "Content-Type": "multipart/form-data",
|
|
|
+ md5: await getMd5FromBlob(file),
|
|
|
+ },
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-export function importExamStudent({ examId, fileName, file, md5 }) {
|
|
|
+export async function importExamStudent({ examId, fileName, file }) {
|
|
|
const form = new FormData();
|
|
|
form.append("examId", examId);
|
|
|
form.append("fileName", fileName);
|
|
|
form.append("file", file);
|
|
|
return httpApp.post("/api/admin/examStudent/import", form, {
|
|
|
- headers: { "Content-Type": "multipart/form-data", md5 },
|
|
|
+ headers: {
|
|
|
+ "Content-Type": "multipart/form-data",
|
|
|
+ md5: await getMd5FromBlob(file),
|
|
|
+ },
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-export function importInvigilator({ examId, fileName, file, md5 }) {
|
|
|
+export async function importInvigilator({ examId, fileName, file }) {
|
|
|
const form = new FormData();
|
|
|
form.append("examId", examId);
|
|
|
form.append("fileName", fileName);
|
|
|
form.append("file", file);
|
|
|
return httpApp.post("/api/admin/invigilateUser/import", form, {
|
|
|
- headers: { "Content-Type": "multipart/form-data", md5 },
|
|
|
+ headers: {
|
|
|
+ "Content-Type": "multipart/form-data",
|
|
|
+ md5: await getMd5FromBlob(file),
|
|
|
+ },
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-export function exportInvigilate({ examId, roomCode, userId }) {
|
|
|
+export async function exportInvigilate({ examId, roomCode, userId }) {
|
|
|
const form = new FormData();
|
|
|
form.append("examId", examId);
|
|
|
form.append("roomCode", roomCode);
|