提交 9f2369dc 编写于 作者: D DebugIsFalse

feature: 添加接口

上级 8ab91b3c
......@@ -13,7 +13,7 @@
</div>
<div class="flex items-center text-sm gap-0.5" :class="textColor">
<UIcon name="i-heroicons-clock" />
<span>52 分钟前</span>
<span>{{formatTime}}</span>
</div>
</div>
<div class="flex gap-4">
......@@ -50,4 +50,7 @@ const props = defineProps({
function handleOpenSelect (id) {
$openLibrarySelect(id)
}
const formatTime = computed(() => {
return useTime(props.item.create_time)
})
</script>
\ No newline at end of file
......@@ -43,11 +43,11 @@ export default () => {
}
// 查询收藏夹会话列表
const findCollection = async (collection_id) => {
const {data, error} = await useRequest(`/v1/collection/${collection_id}/items`, {
method: 'post',
body
})
return { data, error }
const {data, error} = await useRequest(`/v1/collection/${collection_id}/items`, { method: 'get' })
if (error.value) {
return []
}
return data.value.data || []
}
// 删除收藏夹会话
const deleteCollectionRecord = async (collection_id, c_id) => {
......
......@@ -5,11 +5,11 @@
<div class="flex gap-10">
<div class="flex flex-col flex-grow">
<div class="flex flex-col gap-4">
<ILibraryThread />
<ILibraryThread />
<ILibraryThread />
<ILibraryThread />
<ILibraryThread />
<ILibraryThread
v-for="item in themesTagList"
:item="item"
:key="item.id"
/>
</div>
</div>
</div>
......@@ -18,7 +18,20 @@
</template>
<script setup>
const route = useRoute()
const { findCollection } = useCollectionRequest()
const state = reactive({
id: route.params.id
})
const themesTagList = ref([])
async function findCollectionData() {
const data = await findCollection(state.id)
themesTagList.value = data.map(item => {
return {
...item,
title: item.c_title
}
})
console.log(`themesTagList.value:`, themesTagList.value)
}
await findCollectionData()
</script>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册