zhb 2 minggu lalu
induk
melakukan
32e2ce8ddc
1 mengubah file dengan 4 tambahan dan 0 penghapusan
  1. 4 0
      components/cwg-system.vue

+ 4 - 0
components/cwg-system.vue

@@ -17,6 +17,8 @@ import Config from '@/config/index'
 import { customApi } from '@/service/custom'
 import { userToken } from "@/composables/config";
 import { usePopup } from '@/hooks/usePopup'
+import useUserStore from '@/stores/use-user-store'
+const userStore = useUserStore()
 
 const { confirm } = usePopup()
 
@@ -160,6 +162,7 @@ async function confirmSwitchSystem(item: SystemItem) {
     if (props.eventSource === 'login'){
       const baseUrl = `${item.sysUrl}/#/signin`
       // #ifdef H5
+      userStore.clearUser()
       window.location.replace(baseUrl)
       // #endif
 
@@ -173,6 +176,7 @@ async function confirmSwitchSystem(item: SystemItem) {
         const token = typeof accessToken === 'string' ? accessToken : String(accessToken || '')
         const baseUrl = `${item.sysUrl}/#/signin?sysLoginToken=${btoa(token)}`
         // #ifdef H5
+        userStore.clearUser()
         window.location.replace(baseUrl)
         // #endif