From 6a8bc85205bd78848119961d906ed9f8443df0e1 Mon Sep 17 00:00:00 2001 From: DebugIsFalse <511418503@qq.com> Date: Mon, 27 May 2024 16:03:36 +0800 Subject: [PATCH] Update Create.vue --- components/i/Create.vue | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/components/i/Create.vue b/components/i/Create.vue index 6d65107..fd6ee85 100644 --- a/components/i/Create.vue +++ b/components/i/Create.vue @@ -54,19 +54,12 @@ const menuUI = { const handleSearch = async () => { if (loading.value || query.value === '') return loading.value = true - const result = await useRequest('/v1/chat/completion/create', { - method: 'post', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded' - } - }) - if (result && result.data) { - navigateTo(`/search/${result.data.c_id}?query=${query.value}&repo=${selectedRepo.value}`) - emits('search') - nextTick(() => { - loading.value = false - }) - } + const { data } = await useRequest('/v1/chat/completion/create', { method: 'post' }) + navigateTo(`/search/${data.value.data.c_id}`) + emits('search') + nextTick(() => { + loading.value = false + }) } nextTick(async () => { if (!$repos.length) { -- GitLab