|
@@ -116,7 +116,7 @@ store.exam.WEIXIN_ANSWER_ENABLED = true;
|
|
|
useWXSocket();
|
|
|
onMounted(async () => {
|
|
|
const examRecordDataId = store.user.id;
|
|
|
- const response = await httpApp.post(
|
|
|
+ const response = await httpApp.post<string>(
|
|
|
"/api/ecs_oe_student/examControl/getQrCode",
|
|
|
{
|
|
|
examRecordDataId,
|
|
@@ -125,7 +125,13 @@ onMounted(async () => {
|
|
|
testEnv: true,
|
|
|
}
|
|
|
);
|
|
|
- wechat.qrValue = response.data;
|
|
|
+ let origin = window.location.origin;
|
|
|
+ if (import.meta.env.DEV) {
|
|
|
+ origin = import.meta.env.VITE_CONFIG_API_SERVER as string;
|
|
|
+ }
|
|
|
+ const toReplaceOrigin = new URL(response.data).origin;
|
|
|
+
|
|
|
+ wechat.qrValue = response.data.replace(toReplaceOrigin, origin);
|
|
|
const trueExamRecordDataId = decodeURIComponent(wechat.qrValue).match(
|
|
|
/&examRecordDataId=(\d+)/
|
|
|
)![1];
|