type: 定义全局返回值类型

This commit is contained in:
奔跑的面条
2022-06-01 22:41:11 +08:00
parent 93727a0ac7
commit fb0ff50837
12 changed files with 25 additions and 24 deletions
@@ -24,10 +24,10 @@ export const useDataListInit = () => {
// 数据请求
const fetchList = async () => {
loading.value = true
const res: any = await projectListApi({
const res = await projectListApi({
page: paginat.page,
limit: paginat.limit
})
}) as unknown as MyResponseType
if (res.data) {
const { count } = res
paginat.count = count
@@ -86,11 +86,11 @@ export const useDataListInit = () => {
// 发布处理
const releaseHandle = async (cardData: Chartype, index: number) => {
const { id, release } = cardData
const res: any = await changeProjectReleaseApi({
const res = await changeProjectReleaseApi({
id: id,
// [-1未发布, 1发布]
state: !release ? 1 : -1
})
}) as unknown as MyResponseType
if (res.code === ResultEnum.SUCCESS) {
list.value = []
fetchList()
@@ -89,14 +89,14 @@ const btnHandle = async (key: string) => {
case ChartEnum.CHART_HOME_NAME:
try {
// 新增项目
const res:any = await createProjectApi({
const res = await createProjectApi({
// 项目名称
projectName: getUUID(),
// remarks
remarks: null,
// 图片地址
indexImage: null,
})
}) as unknown as MyResponseType
if(res.code === ResultEnum.SUCCESS) {
window['$message'].success(window['$t']('project.create_success'))