From 9118852662e8fcb678d93d9af0f7d98e1b8648a2 Mon Sep 17 00:00:00 2001 From: dshclm <3321914460@qq.com> Date: Thu, 20 Jun 2024 14:21:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AF=86=E8=80=83=E8=AF=95=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=EF=BC=8C=E6=A3=80=E6=B5=8B=E9=A1=B5=E9=9D=A2=E5=88=87?= =?UTF-8?q?=E6=8D=A2=EF=BC=8C=E5=BC=BA=E5=88=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/templates/system/exam/exam.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/resources/templates/system/exam/exam.html b/ruoyi-admin/src/main/resources/templates/system/exam/exam.html index a1e14cf..c783b16 100644 --- a/ruoyi-admin/src/main/resources/templates/system/exam/exam.html +++ b/ruoyi-admin/src/main/resources/templates/system/exam/exam.html @@ -964,6 +964,13 @@ window.location.href = `/system/exam`; } }; + document.addEventListener('visibilitychange',documentVisililityChange) + function documentVisililityChange (){ + alert("检测到您已切换页面,系统将进行强制提交"); + if (document.visibilityState === 'hidden'){ + submitMethid(); + } + } function submitMethid(sub){ var htmlText = ''; var account = 0; //总得分 @@ -1149,7 +1156,6 @@ callInternalFunction: submitMethid }; } -