diff --git a/pages/search/[id].vue b/pages/search/[id].vue index f5ca197d994ef62172e9725b78e58cc710288395..420d3b675c11ff5298e5faa5d3d99e1f6ca7141f 100644 --- a/pages/search/[id].vue +++ b/pages/search/[id].vue @@ -55,9 +55,8 @@ repoData = repoData.data.map(item => { } }) $setRepo(repoData) - // todo mock -const repoItem = $repos.find(item => route.query.repo === item.label) +const repoItem = $repos.find(item => route.query.repo === item.label) || {} const state = reactive({ query: route.query.query || '', repo: route.query.repo || '', @@ -206,6 +205,9 @@ const fetchLinkedQuestion = (query) => { messages.push({ role: 'user', content: query }) fetchRequest('/v1/chat/recomend_question', { method: 'post', + headers: { + 'Content-Type': 'application/json' + }, body: { repo_path: gitPath, c_id: id,