From a53ece5036c1fa61a63fe5f9e0cd3519210ab928 Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Fri, 07 Aug 2026 09:44:27 +0800
Subject: [PATCH] feat:兼容分辨率低不出现滚动条

---
 applications/task-work-order/src/utils/util.js |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/applications/task-work-order/src/utils/util.js b/applications/task-work-order/src/utils/util.js
index 57c3536..4bcb341 100644
--- a/applications/task-work-order/src/utils/util.js
+++ b/applications/task-work-order/src/utils/util.js
@@ -500,3 +500,27 @@
   document.body.removeChild(a)
   a = null
 }
+
+// 统一退出登录
+export async function logOutFun() {
+	// 延迟导入 store 和 router,避免循环依赖:
+	// auth.js → router → store → user.js → auth.js
+	const { default: store } = await import('@/store')
+	const { default: router } = await import('@/router')
+	const { VITE_APP_PARENT_SYSTEM, VITE_APP_ENV } = import.meta.env
+
+	const jumpFun = () => {
+		const urlParams = new URLSearchParams(window.location.search);
+		const openDev = urlParams.get('openDev');
+		const isDev = VITE_APP_ENV === 'development'
+		if (isDev || openDev) {
+			router.push({ path: '/login' })
+			// setTimeout(() => location.reload())
+		} else {
+			window.location.replace(`${VITE_APP_PARENT_SYSTEM}/#/login`)
+		}
+	}
+	store.dispatch('LogOut').then(() => {
+		jumpFun()
+	})
+}

--
Gitblit v1.9.3