perf: 优化接口类型

This commit is contained in:
xiaoxian521
2022-08-18 18:35:09 +08:00
parent d6a329a63c
commit a983575b6d
7 changed files with 37 additions and 28 deletions

View File

@@ -1,12 +1,15 @@
import { http } from "../utils/http";
interface postType extends Promise<any> {
data?: object;
type Result = {
data?: {
/** 列表数据 */
list: Array<any>;
};
code?: number;
msg?: string;
}
};
// 卡片列表
export const getCardList = (data?: object): postType => {
return http.request("post", "/getCardList", { data });
export const getCardList = (data?: object) => {
return http.request<Result>("post", "/getCardList", { data });
};