Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f98f794f
authored
Jun 29, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码优化】AI:音乐、图片的更新状态的接口调整
parent
68c573d9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
20 deletions
+16
-20
src/api/ai/image/index.ts
+2
-8
src/api/ai/music/index.ts
+4
-9
src/views/ai/image/manager/index.vue
+4
-1
src/views/ai/music/manager/index.vue
+6
-2
No files found.
src/api/ai/image/index.ts
View file @
f98f794f
...
...
@@ -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
})
},
// 删除绘画
...
...
src/api/ai/music/index.ts
View file @
f98f794f
...
...
@@ -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
})
},
// 删除音乐
...
...
src/views/ai/image/manager/index.vue
View file @
f98f794f
...
...
@@ -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
...
...
src/views/ai/music/manager/index.vue
View file @
f98f794f
...
...
@@ -135,9 +135,10 @@
</el-link>
</
template
>
</el-table-column>
<el-table-column
label=
"时长(秒)"
align=
"center"
prop=
"duration"
width=
"100"
/>
<el-table-column
label=
"提示词"
align=
"center"
prop=
"prompt"
width=
"180"
/>
<el-table-column
label=
"歌词"
align=
"center"
prop=
"lyric"
width=
"180"
/>
<el-table-column
label=
"描述
词
"
align=
"center"
prop=
"gptDescriptionPrompt"
width=
"180"
/>
<el-table-column
label=
"描述"
align=
"center"
prop=
"gptDescriptionPrompt"
width=
"180"
/>
<el-table-column
label=
"生成模式"
align=
"center"
prop=
"generateMode"
width=
"100"
>
<
template
#
default=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.AI_GENERATE_MODE"
:value=
"scope.row.generateMode"
/>
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment