From 7f0277a65ed5e59317a7fe885c9219c875f1ed77 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期四, 05 六月 2025 17:28:28 +0800 Subject: [PATCH] 刷新页面 --- src/layout/components/Navbar.vue | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 3c70204..2a0f437 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -135,12 +135,18 @@ password: Cookies.get("password") === undefined ? null : decrypt(Cookies.get("password")), currentFatoryId: currentFatoryId } + console.log('loginForm', loginForm) userStore.loginCheckFactory(loginForm).then(res => { - window.location.reload(); + forceReload(); }).catch((err) => { console.log(err) }) } +function forceReload() { + const currentUrl = window.location.origin + window.location.pathname; + const timestamp = new Date().getTime(); + window.location.href = `${currentUrl}?reload=${timestamp}`; +} getUserLoginFacotryList(); </script> -- Gitblit v1.9.3