From f98f794f77a05f812ce51f077046c8e488a372f5 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 29 Jun 2024 09:47:11 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91AI=EF=BC=9A=E9=9F=B3=E4=B9=90=E3=80=81=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E7=9A=84=E6=9B=B4=E6=96=B0=E7=8A=B6=E6=80=81=E7=9A=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ai/image/index.ts | 10 ++-------- src/api/ai/music/index.ts | 13 ++++--------- src/views/ai/image/manager/index.vue | 5 ++++- src/views/ai/music/manager/index.vue | 8 ++++++-- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/api/ai/image/index.ts b/src/api/ai/image/index.ts index df3b9b5a..82d4f594 100644 --- a/src/api/ai/image/index.ts +++ b/src/api/ai/image/index.ts @@ -96,14 +96,8 @@ export const ImageApi = { }, // 更新绘画发布状态 - updateImagePublicStatus: async (id: number, publicStatus: boolean) => { - return await request.put({ - url: '/ai/image/update-public-status', - data: { - id, - publicStatus - } - }) + updateImage: async (data: any) => { + return await request.put({ url: '/ai/image/update-public-status', data }) }, // 删除绘画 diff --git a/src/api/ai/music/index.ts b/src/api/ai/music/index.ts index 220f85e6..74b85268 100644 --- a/src/api/ai/music/index.ts +++ b/src/api/ai/music/index.ts @@ -16,6 +16,7 @@ export interface MusicVO { model: string // 模型 generateMode: number // 生成模式 tags: string // 音乐风格标签 + duration: number // 音乐时长 publicStatus: boolean // 是否发布 taskId: string // 任务id errorMessage: string // 错误信息 @@ -28,15 +29,9 @@ export const MusicApi = { return await request.get({ url: `/ai/music/page`, params }) }, - // 更新绘画发布状态 - updateMusicPublicStatus: async (id: number, publicStatus: boolean) => { - return await request.put({ - url: '/ai/music/update-public-status', - data: { - id, - publicStatus - } - }) + // 更新音乐 + updateMusic: async (data: any) => { + return await request.put({ url: '/ai/music/update', data }) }, // 删除音乐 diff --git a/src/views/ai/image/manager/index.vue b/src/views/ai/image/manager/index.vue index d7ac6c81..f0e94faa 100644 --- a/src/views/ai/image/manager/index.vue +++ b/src/views/ai/image/manager/index.vue @@ -231,7 +231,10 @@ const handleUpdatePublicStatusChange = async (row: ImageVO) => { const text = row.publicStatus ? '公开' : '私有' await message.confirm('确认要"' + text + '"该图片吗?') // 发起修改状态 - await ImageApi.updateImagePublicStatus(row.id, row.publicStatus) + await ImageApi.updateImage({ + id: row.id, + publicStatus: row.publicStatus + }) await getList() } catch { row.publicStatus = !row.publicStatus diff --git a/src/views/ai/music/manager/index.vue b/src/views/ai/music/manager/index.vue index dc7f41a5..ec3c12b0 100644 --- a/src/views/ai/music/manager/index.vue +++ b/src/views/ai/music/manager/index.vue @@ -135,9 +135,10 @@ + - +