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 @@
+
-
+
@@ -265,7 +266,10 @@ const handleUpdatePublicStatusChange = async (row: MusicVO) => {
const text = row.publicStatus ? '公开' : '私有'
await message.confirm('确认要"' + text + '"该音乐吗?')
// 发起修改状态
- await MusicApi.updateMusicPublicStatus(row.id, row.publicStatus)
+ await MusicApi.updateMusic({
+ id: row.id,
+ publicStatus: row.publicStatus
+ })
await getList()
} catch {
row.publicStatus = !row.publicStatus