|
@@ -7,7 +7,9 @@ import ScoringGrade from '@/components/ScoringGrade'
|
|
|
import AIRobot from '@/components/AIRobot'
|
|
import AIRobot from '@/components/AIRobot'
|
|
|
import AIRobotChat from '@/views/AIRobotChat/src/AIRobotChat.vue'
|
|
import AIRobotChat from '@/views/AIRobotChat/src/AIRobotChat.vue'
|
|
|
import LogoMenu from './images/logo_menu.png'
|
|
import LogoMenu from './images/logo_menu.png'
|
|
|
|
|
+import { useUserStore } from '@/stores/modules/user'
|
|
|
|
|
|
|
|
|
|
+const userStore = useUserStore()
|
|
|
const leftAsideWidth = ref('232px')
|
|
const leftAsideWidth = ref('232px')
|
|
|
const isCollapse = ref(false)
|
|
const isCollapse = ref(false)
|
|
|
const handleMenuCollapse = (val: boolean) => {
|
|
const handleMenuCollapse = (val: boolean) => {
|
|
@@ -36,6 +38,14 @@ const handelClickAIDefault = async (item: any) => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+watch(
|
|
|
|
|
+ () => userStore.isLogin,
|
|
|
|
|
+ (newVal) => {
|
|
|
|
|
+ if (!newVal) {
|
|
|
|
|
+ AIRobotChatref.value?.clearData()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+)
|
|
|
const getPrompt = () => {
|
|
const getPrompt = () => {
|
|
|
$api.getPrompt().then((res) => {
|
|
$api.getPrompt().then((res) => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
@@ -44,7 +54,9 @@ const getPrompt = () => {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- getPrompt()
|
|
|
|
|
|
|
+ if (userStore.isLogin) {
|
|
|
|
|
+ getPrompt()
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
</script>
|
|
</script>
|
|
|
<template>
|
|
<template>
|