From 964bf61c37034921c9da71c67b4a7eb41add24ed Mon Sep 17 00:00:00 2001 From: sigoden Date: Sat, 24 Aug 2024 15:52:29 +0800 Subject: [PATCH] refactor: improve logout at asserts/index.js (#440) --- assets/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/index.js b/assets/index.js index ab29f8b..5141649 100644 --- a/assets/index.js +++ b/assets/index.js @@ -758,10 +758,10 @@ function logout() { const url = baseUrl(); const xhr = new XMLHttpRequest(); xhr.open("AUTH", url, true, ":"); - xhr.send(); - setTimeout(() => { + xhr.onload = () => { location.href = url; - }, 200); + } + xhr.send(); } /**