From a1ddf1f0e75e9008dd7d0a419ce79f916c24e81a Mon Sep 17 00:00:00 2001 From: DebugIsFalse <511418503@qq.com> Date: Tue, 28 May 2024 19:34:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=BC=E5=AE=B9=E4=B8=8D=E5=A1=AB?= =?UTF-8?q?=E5=86=99git=E4=BB=93=E5=BA=93=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/i/Create.vue | 5 +++-- pages/search/[id].vue | 14 ++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/components/i/Create.vue b/components/i/Create.vue index ae0e20c..338416d 100644 --- a/components/i/Create.vue +++ b/components/i/Create.vue @@ -40,7 +40,7 @@ const { $setRepo } = useReposStore() const { $getSearchHistory } = useSearchStore() const emits = defineEmits([ 'search' ]) const query = ref('') -const selectedRepo = ref('keycloak') +const selectedRepo = ref('') const loading = ref(false) const cardUI = { body: { @@ -56,10 +56,11 @@ const handleSearch = async () => { if (loading.value || query.value === '') return loading.value = true const currentRepo = $repos.value.find(item => item.label === selectedRepo.value) + const repo_path = currentRepo ? currentRepo.url : '' const { data } = await useRequest('/v1/chat/completion/create', { method: 'post', body: { - repo_path: currentRepo.url, + repo_path, title: query.value } }) diff --git a/pages/search/[id].vue b/pages/search/[id].vue index bb49fd0..15ddef9 100644 --- a/pages/search/[id].vue +++ b/pages/search/[id].vue @@ -7,7 +7,7 @@