|
|
@@ -4004,7 +4004,7 @@ onMounted(() => {
|
|
|
|
|
|
|
|
|
// beforeunload 事件(页面刷新或关闭)
|
|
|
- window.addEventListener('beforeunload', handlePageUnload)
|
|
|
+ // window.addEventListener('beforeunload', handlePageUnload)
|
|
|
|
|
|
// visibilitychange 事件(适用于 iframe 嵌套场景,当外层页面返回时触发)
|
|
|
const handleVisibilityChange = () => {
|
|
|
@@ -4023,7 +4023,7 @@ onMounted(() => {
|
|
|
|
|
|
// 存储清理函数,方便在 onUnmounted 中移除
|
|
|
;(window as any).__pptistStudentUnloadHandlers = {
|
|
|
- beforeunload: handlePageUnload,
|
|
|
+ // beforeunload: handlePageUnload,
|
|
|
visibilitychange: handleVisibilityChange,
|
|
|
pagehide: handlePageUnload
|
|
|
}
|
|
|
@@ -4073,7 +4073,7 @@ onUnmounted(() => {
|
|
|
// 清理页面卸载相关的事件监听器
|
|
|
if ((window as any).__pptistStudentUnloadHandlers) {
|
|
|
const handlers = (window as any).__pptistStudentUnloadHandlers
|
|
|
- window.removeEventListener('beforeunload', handlers.beforeunload)
|
|
|
+ // window.removeEventListener('beforeunload', handlers.beforeunload)
|
|
|
document.removeEventListener('visibilitychange', handlers.visibilitychange)
|
|
|
window.removeEventListener('pagehide', handlers.pagehide)
|
|
|
delete (window as any).__pptistStudentUnloadHandlers
|