diff --git a/src/components/input/ChatInput.vue b/src/components/input/ChatInput.vue index 1e78c93..9418a52 100644 --- a/src/components/input/ChatInput.vue +++ b/src/components/input/ChatInput.vue @@ -173,6 +173,8 @@ import AttachmentPreview from "./AttachmentPreview.vue"; import { generateId } from "@/utils/helpers"; import type { Attachment } from "@/types/chat"; import { chatApi } from "@/services/api"; +import { useAuthStore } from "@/stores/auth"; +import { useSettingsStore } from "@/stores/settings"; interface AttachmentWithProgress extends Attachment { uploading?: boolean; @@ -216,6 +218,9 @@ const emit = defineEmits<{ }>(); // 响应式状态 +const authStore = useAuthStore(); +const settingsStore = useSettingsStore(); + const inputText = ref(""); const attachments = ref([]); const isFocused = ref(false); @@ -467,6 +472,15 @@ watch(inputText, () => { autoResize(); }); }); +// 监听模型变化,重置选项功能 +watch( + () => settingsStore.settings.defaultModel, + () => { + isDeepSearch.value = false; + isDeepThinking.value = false; + isWebSearch.value = false; + }, +); onMounted(() => { autoResize(); diff --git a/src/components/sidebar/ChatSidebar.vue b/src/components/sidebar/ChatSidebar.vue index 2b9ad7b..c656ec1 100644 --- a/src/components/sidebar/ChatSidebar.vue +++ b/src/components/sidebar/ChatSidebar.vue @@ -212,6 +212,11 @@ function selectModel(modelId: string, modelName: string) { localStorage.setItem("modelSelect", modelName); settingsStore.setSelectedModelId(modelId); // 更新选中的模型 ID showModelMenu.value = false; + + // 切换模型时重置搜索和思考参数 + localStorage.setItem("isDeepSearch", "false"); + localStorage.setItem("isDeepThinking", "false"); + localStorage.setItem("isWebSearch", "false"); } // 方法