|
@@ -9,8 +9,9 @@ import router from "@/router";
|
|
|
import { checkExamInProgress } from "../UserLogin/useExamInProgress";
|
|
|
import { store } from "@/store/store";
|
|
|
import { closeMediaStream } from "@/utils/camera";
|
|
|
-import { decryptB, decryptC, encryptB, encryptC, getKey } from "@/utils/utils";
|
|
|
+import { getKey } from "@/utils/utils";
|
|
|
import { AxiosError } from "axios";
|
|
|
+import { doDec, doEnc } from "@/utils/encDec";
|
|
|
|
|
|
const { course } = defineProps<{ course: OnlineExam }>();
|
|
|
|
|
@@ -234,12 +235,10 @@ async function enterExam() {
|
|
|
});
|
|
|
|
|
|
const key = getKey(timestamp);
|
|
|
- // console.log({ rawStr, key });
|
|
|
+ console.log({ rawStr, key });
|
|
|
|
|
|
let encryptParams = "";
|
|
|
- // if (store.user.salt === "E") {
|
|
|
- encryptParams = encryptC(encryptB(rawStr), key);
|
|
|
- // }
|
|
|
+ encryptParams = doEnc(rawStr, key);
|
|
|
|
|
|
try {
|
|
|
let res = await httpApp.post<string>(
|
|
@@ -252,7 +251,7 @@ async function enterExam() {
|
|
|
}
|
|
|
);
|
|
|
|
|
|
- res.data = decryptB(decryptC(res.data, key));
|
|
|
+ res.data = doDec(res.data, key);
|
|
|
// console.log(res.data);
|
|
|
const newRes: {
|
|
|
courseName: string;
|