fix: 修复火狐重定向时报错

This commit is contained in:
2025-09-23 15:27:16 +08:00
parent f4ead35b0b
commit 2693e2f3a6

View File

@@ -167,8 +167,8 @@
<div
v-if="data.unlockMode === 1"
class="goclass"
@click="
toFinish(el, item.stageName, item.id, item.studyModel)
@click.prevent="
toFinish(el, item.stageName, item.id, item.studyModel, $event)
"
:style="{
background:
@@ -188,7 +188,7 @@
<div
v-else
class="goclass"
@click="
@click.prevent="
toFinish(el, item.stageName, item.id, item.studyModel)
"
:style="{
@@ -550,7 +550,7 @@ function judgeTaskIsEnd(type, endTimes, status) {
return isEnd;
}
function toFinish(d, sName, chapterOrStageId, studyModel) {
function toFinish(d, sName, chapterOrStageId, studyModel,e) {
if (studyModel != 0 && !d.statusName) {
ElMessage.warning("当前未解锁");
return;
@@ -753,14 +753,13 @@ function toFinish(d, sName, chapterOrStageId, studyModel) {
type: PROJECT,
pid: projectId,
name: d.name,
});
if (typeof TASK_TYPES.path[d.type] === "string") {
console.log("TASK_TYPES.path[d.type]", TASK_TYPES.path[d.type]);
TASK_TYPES.path[d.type] &&
}).then(()=>{
if (typeof TASK_TYPES.path[d.type] === "string") {
console.log("TASK_TYPES.path[d.type]", TASK_TYPES.path[d.type]);
TASK_TYPES.path[d.type] &&
TASK_TYPES.path[d.type].startsWith("http") &&
window.open(TASK_TYPES.path[d.type] + d.targetId, "_top");
TASK_TYPES.path[d.type] &&
TASK_TYPES.path[d.type] &&
TASK_TYPES.path[d.type].startsWith("/") &&
router.push({
path: TASK_TYPES.path[d.type],
@@ -780,21 +779,23 @@ function toFinish(d, sName, chapterOrStageId, studyModel) {
quizTaskId: d.quizTaskId,
},
});
} else if (typeof TASK_TYPES.path[d.type] === "function") {
if (d.type == 5) {
// 模拟点击跳转
const url = TASK_TYPES.path[d.type](d) + d.targetId
const a = document.createElement("a");
a.href = url;
// a.target = "_blank";
a.click();
} else if (typeof TASK_TYPES.path[d.type] === "function") {
if (d.type == 5) {
const url = TASK_TYPES.path[d.type](d) + d.targetId
if (isIOS()){
// 模拟点击跳转
const a = document.createElement("a");
a.href = url;
// a.target = "_blank";
a.click();
// 保底解决兼容问题
window.open(url, "_top");
} else {
TASK_TYPES.path[d.type](d);
}
}
}}})
// if (typeof types.value.path[d.type] === "string") {
// types.value.path[d.type] &&
// types.value.path[d.type].startsWith("http") &&