From 874ae825083ee5576c6e6cacc7cb4bba15c0077a Mon Sep 17 00:00:00 2001
From: zhangyongtian <1181606322@qq.com>
Date: Sat, 14 Sep 2024 10:36:53 +0800
Subject: [PATCH] feat: 对接网格单点登录

---
 gz-customerSystem/src/components/Layout/index.jsx |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/gz-customerSystem/src/components/Layout/index.jsx b/gz-customerSystem/src/components/Layout/index.jsx
index 92aec73..36eca5f 100644
--- a/gz-customerSystem/src/components/Layout/index.jsx
+++ b/gz-customerSystem/src/components/Layout/index.jsx
@@ -117,20 +117,20 @@
 			token
 		})
 		if (res.type) {
-			setGridStatus(true)
-			$$.setSessionStorage('gridToken', '')
+			$$.clearSessionStorage();
 			$$.setSessionStorage('customerSystemToken', res.data?.token);
 			$$.setLocal('customerSystemUser', res.data || {});
 			let ctUseroleList = res.data?.ctUseroleList || [];
+			console.log(ctUseroleList);
 			const roleId = ctUseroleList[0]?.roleId
 			const roleName = ctUseroleList[0]?.roleName
 			const roleCode = ctUseroleList[0]?.roleCode
 			$$.setSessionStorage('role', { roleId: roleId, roleName: roleName });
 			setRoleActive({ id: roleId, roleName: roleName, powerMap: {} });
-			const res = await switchRoleApi({ roleCode: roleCode });
-			if (res.type) {
-				$$.setSessionStorage('customerSystemToken', res.data);
-				navigate('/mediate/visit/visitWorkBench');
+			const result = await switchRoleApi({ roleCode: roleCode });
+			if (result.type) {
+				$$.setSessionStorage('customerSystemToken', result.data);
+				setGridStatus(true)
 			}
 		}
 	}
@@ -207,7 +207,7 @@
 			getRolePower(roleActive.id, roleActive.roleName);
 		}
 	}, [roleActive.id]);
-
+console.log(gridStatus);
 	return (
 		<>
 			<Header

--
Gitblit v1.8.0