load history or not
This commit is contained in:
@@ -85,6 +85,22 @@
|
||||
folder:"{{workspace_path}}"
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
// 检测页面刷新事件
|
||||
window.addEventListener('beforeunload', function(e) {
|
||||
// 这里不弹出提示,只在页面刷新时执行跳转
|
||||
// 但是beforeunload中不能直接跳转,所以我们需要在页面加载时检测是否是刷新
|
||||
});
|
||||
|
||||
// 检测是否是页面刷新
|
||||
if (performance.navigation.type === 1 || performance.getEntriesByType("navigation")[0].type === "reload") {
|
||||
// 是刷新操作,跳转到确认页面
|
||||
const course_id = "{{course_id}}";
|
||||
const chapter_name = "{{chapter_name}}";
|
||||
const lesson_name = "{{lesson_name}}";
|
||||
window.location.href = `/desktop_nouser/${course_id}/${chapter_name}/${lesson_name}`;
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user