Browse Source

fix:修改接口调用

AmandaG 2 months ago
parent
commit
1a497f2e77

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

@@ -129,7 +129,6 @@ onMounted(() => {
   if(localStorage.getItem('userInfo') != null) {
     AIIconVisible.value = true
   }
-  AIRobotInit()
   emitter.on('login-success', isShowLogin)
   emitter.on('login-out', Logout)
   emitter.on('checkPrompt', Logout)

+ 2 - 1
src/views/AIRobotChat/src/components/AIQuestions.vue

@@ -1,5 +1,6 @@
 <script setup lang="ts">
 import { ref, onMounted } from 'vue'
+import emitter from '@/utils/bus'
 
 const props = defineProps<{
   modalSize: String
@@ -95,7 +96,7 @@ const generatePages = () => {
   pages.value = result.filter((p) => p.row1.length > 0)
 }
 onMounted(() => {
-  AIRobotInit()
+  emitter.on('login-success', AIRobotInit)
 })
 
 defineExpose({