Skip to content

Commit b82391d

Browse files
committed
【解决todo】调整接口命名、和接口返回值
1 parent ecc9243 commit b82391d

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

src/api/ai/image/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ export interface ImageDallReqVO {
3434
export const ImageApi = {
3535
// 获取 image 列表
3636
getImageList: async (params: ImagePageReqVO) => {
37-
return await request.get({ url: `/ai/image/list`, params })
37+
return await request.get({ url: `/ai/image/my-page`, params })
3838
},
3939
// 获取 image 详细信息
4040
getImageDetail: async (id: number) => {
41-
return await request.get({ url: `/ai/image/get?id=${id}`})
41+
return await request.get({ url: `/ai/image/get-my?id=${id}`})
4242
},
4343
// dall2、dall3 调用
4444
dall: async (data: ImageDallReqVO)=> {
4545
return await request.post({ url: `/ai/image/dall`, data })
4646
},
4747
// 删除
4848
deleteImage: async (id: number)=> {
49-
return await request.delete({ url: `/ai/image/delete?id=${id}`})
49+
return await request.delete({ url: `/ai/image/delete-my?id=${id}`})
5050
},
5151
}

src/views/ai/image/ImageTaskCard.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<el-card body-class="" class="image-card">
33
<div class="image-operation">
44
<div>
5-
<el-button type="" text bg v-if="imageDetail.status === 'in_progress'">生成中</el-button>
6-
<el-button type="" text bg v-else-if="imageDetail.status === 'fail'">已完成</el-button>
7-
<el-button type="" text bg v-else-if="imageDetail.status === 'complete'">已完成</el-button>
5+
<el-button type="" text bg v-if="imageDetail.status === '10'">生成中</el-button>
6+
<el-button type="" text bg v-else-if="imageDetail.status === '20'">已完成</el-button>
7+
<el-button type="" text bg v-else-if="imageDetail.status === '30'">已完成</el-button>
88
</div>
99
<div>
1010
<el-button class="btn" text :icon="Download"
@@ -42,7 +42,7 @@ const handlerBtnClick = async (type, imageDetail: ImageDetailVO) => {
4242
}
4343
4444
const handlerLoading = async (status: string) => {
45-
if (status === 'in_progress') {
45+
if (status === '10') {
4646
cardImageLoadingInstance.value = ElLoading.service({
4747
target: cardImageRef.value,
4848
text: '生成中...'

src/views/ai/image/dall3/index.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ interface ImageModelVO {
110110
interface ImageSizeVO {
111111
key: string
112112
style: string,
113+
width: string,
114+
height: string,
113115
}
114116
115117
// 定义属性
@@ -152,16 +154,22 @@ const imageSizeList = ref<ImageSizeVO[]>([
152154
{
153155
key: '1024x1024',
154156
name: '1:1',
157+
width: '1024',
158+
height: '1024',
155159
style: 'width: 30px; height: 30px;background-color: #dcdcdc;',
156160
},
157161
{
158162
key: '1024x1792',
159163
name: '3:5',
164+
width: '1024',
165+
height: '1792',
160166
style: 'width: 30px; height: 50px;background-color: #dcdcdc;',
161167
},
162168
{
163169
key: '1792x1024',
164170
name: '5:3',
171+
width: '1792',
172+
height: '1024',
165173
style: 'width: 50px; height: 30px;background-color: #dcdcdc;',
166174
}
167175
]) // size
@@ -233,7 +241,8 @@ const handlerGenerateImage = async () => {
233241
prompt: prompt.value, // 提示词
234242
model: selectModel.value.key, // 模型
235243
style: selectImageStyle.value.key, // 图像生成的风格
236-
size: selectImageSize.value.key, // size不能为空
244+
width: selectImageSize.value.width, // size不能为空
245+
height: selectImageSize.value.height, // size不能为空
237246
} as ImageDallReqVO
238247
// 发送请求
239248
await ImageApi.dall(form)

0 commit comments

Comments
 (0)