|
@@ -270,25 +270,29 @@ export default {
|
|
|
|
|
|
const params = new URLSearchParams();
|
|
const params = new URLSearchParams();
|
|
params.append("fileSuffix", "png");
|
|
params.append("fileSuffix", "png");
|
|
- // params.append("fileMd5", fileMd5);
|
|
|
|
|
|
+ params.append("fileMd5", fileMd5);
|
|
const res = await this.$http.get(
|
|
const res = await this.$http.get(
|
|
"/api/ecs_oe_student/examControl/getCapturePhotoUpYunSign?" + params
|
|
"/api/ecs_oe_student/examControl/getCapturePhotoUpYunSign?" + params
|
|
);
|
|
);
|
|
|
|
|
|
console.log(res);
|
|
console.log(res);
|
|
|
|
|
|
- let myHeaders = new Headers();
|
|
|
|
- for (let [k, v] of Object.entries(res.data.headers)) {
|
|
|
|
- // console.log(k, v);
|
|
|
|
- if (k.includes("tion") || k.includes("Date") || k.includes("MD5")) {
|
|
|
|
- if (k === "Date") k = "x-date";
|
|
|
|
- myHeaders.append(k, v);
|
|
|
|
- }
|
|
|
|
|
|
+ // let myHeaders = new Headers();
|
|
|
|
+ // for (let [k, v] of Object.entries(res.data.headers)) {
|
|
|
|
+ // // console.log(k, v);
|
|
|
|
+ // if (k.includes("tion") || k.includes("Date") || k.includes("MD5")) {
|
|
|
|
+ // if (k === "Date") k = "x-date";
|
|
|
|
+ // myHeaders.append(k, v);
|
|
|
|
+ // }
|
|
|
|
+ let myFormData = new FormData();
|
|
|
|
+ for (let [k, v] of Object.entries(res.data.formParams)) {
|
|
|
|
+ myFormData.append(k, v);
|
|
}
|
|
}
|
|
- const response = await fetch(res.data.uploadUrl, {
|
|
|
|
- mode: "cors",
|
|
|
|
- method: "PUT",
|
|
|
|
- headers: myHeaders,
|
|
|
|
|
|
+ myFormData.append("file", captureBlob);
|
|
|
|
+
|
|
|
|
+ const response = await fetch(res.data.formUrl, {
|
|
|
|
+ method: "POST",
|
|
|
|
+ body: myFormData,
|
|
});
|
|
});
|
|
|
|
|
|
console.log(response);
|
|
console.log(response);
|
|
@@ -372,7 +376,7 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
let body = {
|
|
let body = {
|
|
- fileUrl: encodeURIComponent(captureFilePath),
|
|
|
|
|
|
+ fileUrl: captureFilePath,
|
|
signIdentifier,
|
|
signIdentifier,
|
|
examRecordDataId,
|
|
examRecordDataId,
|
|
};
|
|
};
|