From 3a460b9ac63d5f9ae297aa93fe08ed53ed114449 Mon Sep 17 00:00:00 2001 From: lkddi Date: Thu, 2 Apr 2026 09:10:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=95=BF=E6=97=B6=E9=97=B4=E5=81=9C=E7=95=99?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=20CSRF=20=E5=A4=B1=E6=95=88=E6=97=B6?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=98=BE=E7=A4=BA=E4=B8=AD=E6=96=87=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E5=B9=B6=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/index.blade.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index 08eee1e..65586c6 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -452,6 +452,14 @@ body }))) .then(result => { + if (result.status === 419 || (result.body && result.body.message === 'CSRF token mismatch.')) { + showAlert('安全令牌已过期,正在自动刷新...', 'error'); + setTimeout(() => { + window.location.reload(); + }, 1500); + return; + } + if (result.status === 200 && result.body.status === 'success') { showAlert(result.body.message, 'success'); const chatUrl = '/room/' + roomId;