diff --git a/components/i/Create.vue b/components/i/Create.vue index 6d651070252abac7b54c750b578b114d123c89d9..fd6ee85c8d5a833dcdf50fcb59f54bb16cb198bb 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) {