Browse Source

切换机构重置路由

cynthia-qin 1 month ago
parent
commit
49e62a3760
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/components/LayoutHeader.vue

+ 6 - 1
src/components/LayoutHeader.vue

@@ -82,6 +82,8 @@ const changeOrg = async (orgId) => {
  const res =  await proxy.$http.post(`/open-platform/sys/changeSURO/${orgId}`)
  console.log('切换机构结果:', res)
   saveSessionVar('org_id', orgId)
+   saveSessionVar("knowledageSystem", '');
+    saveSessionVar('routeList', '')
   // 可选:刷新页面或重新拉取权限/菜单等
   updateRouteList([]);
   let knowledageSystem = '';
@@ -117,11 +119,14 @@ const changeOrg = async (orgId) => {
     saveSessionVar('routeList', JSON.stringify(routeList))
 
     updateRouteList(routeList);
-  // window.location.reload()
+    
+  // 刷新页面
+  window.location.href = '/kmplatform/home';
 }
 
 let editPassShow = ref(false)
 const currentPath = computed(() => {
+  console.log('当前路由:', route)
   let temp = ""
   for (let i = 0; i < routeList.length; i++) {
     for (let j = 0; j < route.matched.length; j++) {