提交 c17df9c5 编写于 作者: View Design's avatar View Design

update

上级 8c48fffb
......@@ -55,19 +55,21 @@ const handleSearch = async () => {
}
}
let repoData = await fetchRequest('/v1/chat/repository', {
if (!$repos.length) {
let repoData = await fetchRequest('/v1/chat/repository', {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
repoData = repoData.data.map(item => {
})
repoData = repoData.data.map(item => {
return {
label: item.name,
url: item.path,
branch: item.branch
}
})
$setRepo(repoData)
})
$setRepo(repoData)
}
defineShortcuts({
meta_enter: {
......
......@@ -42,19 +42,22 @@ const { fetchRequest } = useFetchRequest()
const editIndex = ref(0)
const { y } = useWindowScroll({ behavior: 'smooth' })
const { directions } = useScroll(window)
let repoData = await fetchRequest('/v1/chat/repository', {
if (!$repos.length) {
let repoData = await fetchRequest('/v1/chat/repository', {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).catch(()=> {})
repoData = repoData && repoData.data.map(item => {
}).catch(()=> {})
repoData = repoData && repoData.data.map(item => {
return {
label: item.name,
url: item.path,
branch: item.branch
}
})
$setRepo(repoData)
})
$setRepo(repoData)
}
// todo mock
const repoItem = $repos.find(item => route.query.repo === item.label) || {}
const state = reactive({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册