瀏覽代碼

feat:修改登录没有默认问题

AmandaG 6 月之前
父節點
當前提交
0e9742355c

+ 1 - 2
src/auto-imports.d.ts

@@ -3,7 +3,6 @@
 // @ts-nocheck
 // noinspection JSUnusedGlobalSymbols
 // Generated by unplugin-auto-import
-// biome-ignore lint: disable
 export {}
 declare global {
   const $api: typeof import('@/api/index')['default']
@@ -69,6 +68,6 @@ declare global {
 // for type re-export
 declare global {
   // @ts-ignore
-  export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
+  export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
   import('vue')
 }

+ 2 - 0
src/components/AIRobot/src/AIRobot.vue

@@ -81,6 +81,7 @@ const prepareGroups = () => {
   itemGroups.value = groups
 }
 const isShowLogin = () => {
+  AIRobotInit()
   const loginCount = JSON.parse(localStorage.getItem('userInfo')).loginCount
   let settimeouttime = 0
   AIIconVisible.value = true
@@ -108,6 +109,7 @@ const Logout = () => {
 
 // 退出登录后隐藏icon
 const checknoPrompt = () => {
+  AIRobotInit()
   AIIconVisible.value = true
 }
 

+ 2 - 0
src/views/Layout/src/components/Header/HeaderView.vue

@@ -11,6 +11,7 @@ import { useThemeStore } from '@/stores/modules/theme'
 import { useNotificationMessage } from '@/stores/modules/notificationMessage'
 import NotificationDrawer from './components/NotificationDrawer.vue'
 import TrainingCard from './components/TrainingCard.vue'
+import emitter from '@/utils/bus'
 
 const notificationMsgStore = useNotificationMessage()
 const themeStore = useThemeStore()
@@ -132,6 +133,7 @@ const handleUserManual = () => {
         }
         if (res.data?.code === 403) {
           sessionStorage.clear()
+          emitter.emit('login-out');
           router.push('/login')
           userStore.logout()
           ElMessage.warning({