feat: 接口增加泛型支持

This commit is contained in:
a876691666
2022-11-27 12:16:32 +08:00
parent 02ec3c78d6
commit f8ebaa60b1
8 changed files with 153 additions and 68 deletions
@@ -27,11 +27,11 @@ export const useDataListInit = () => {
const res = await projectListApi({
page: paginat.page,
limit: paginat.limit
}) as any
if (res.data) {
const { count } = res
});
if (res &&res.data) {
const { count } = res as any; // 这里的count与data平级,不在Response结构中
paginat.count = count
list.value = res.data.map((e: any) => {
list.value = res.data.map((e) => {
const { id, projectName, state, createTime, indexImage, createUserId } = e
return {
id: id,
+1 -1
View File
@@ -1,7 +1,7 @@
export type Chartype = {
id: number | string
title: string // 标题
label: string // 标签
label?: string // 标签
time: string, // 时间
image: string, // 预览图地址
createId: string, // 创建者