mirror of
https://gitee.com/dromara/go-view.git
synced 2026-05-12 00:00:01 +08:00
type: 定义全局返回值类型
This commit is contained in:
@@ -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()
|
||||
|
||||
+2
-2
@@ -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'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user