From 23192c50ad53f5f243648bb9d2a0a40fa56682b2 Mon Sep 17 00:00:00 2001 From: HCode <71808213+hyf-github-user@users.noreply.github.com> Date: Wed, 6 Nov 2024 13:28:57 +0800 Subject: [PATCH] Add headshots api (#146) --- ...cloud-nexior-7d76920f-035f-4b4e-a507-94a69cbbd589.json | 7 +++++++ src/components/headshots/ImageGallery.vue | 2 +- src/components/headshots/config/ImageUrlsInput.vue | 5 ++++- src/i18n/zh-CN/headshots.json | 5 ++++- src/i18n/zh-CN/site.json | 8 ++++++++ src/operators/headshots.ts | 6 +++--- 6 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 change/@acedatacloud-nexior-7d76920f-035f-4b4e-a507-94a69cbbd589.json diff --git a/change/@acedatacloud-nexior-7d76920f-035f-4b4e-a507-94a69cbbd589.json b/change/@acedatacloud-nexior-7d76920f-035f-4b4e-a507-94a69cbbd589.json new file mode 100644 index 00000000..ea2df4b9 --- /dev/null +++ b/change/@acedatacloud-nexior-7d76920f-035f-4b4e-a507-94a69cbbd589.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "add headshots api", + "packageName": "@acedatacloud/nexior", + "email": "1348977728@qq.com", + "dependentChangeType": "patch" +} diff --git a/src/components/headshots/ImageGallery.vue b/src/components/headshots/ImageGallery.vue index 755819a4..fa15593d 100644 --- a/src/components/headshots/ImageGallery.vue +++ b/src/components/headshots/ImageGallery.vue @@ -2,7 +2,7 @@ diff --git a/src/components/headshots/config/ImageUrlsInput.vue b/src/components/headshots/config/ImageUrlsInput.vue index 733b1ed4..60fca281 100644 --- a/src/components/headshots/config/ImageUrlsInput.vue +++ b/src/components/headshots/config/ImageUrlsInput.vue @@ -56,7 +56,10 @@ export default defineComponent({ }, urls(): string[] { // @ts-ignore - return this.fileList.map((file: UploadFile) => file?.response?.file_url); + return this.fileList.map((file: UploadFile) => { + const url = file?.response?.file_url; + return url.replace('https://cdn.acedata.cloud', 'https://acedata-cdn.zhishuyun.com'); + }); }, value: { get() { diff --git a/src/i18n/zh-CN/headshots.json b/src/i18n/zh-CN/headshots.json index 62d0372a..912062af 100644 --- a/src/i18n/zh-CN/headshots.json +++ b/src/i18n/zh-CN/headshots.json @@ -97,7 +97,10 @@ "message": "生成", "description": "生成Headshots证件照 的按钮文本" }, - + "button.viewImage": { + "message": "查看原图", + "description": "生成Headshots证件照 的按钮文本" + }, "button.download": { "message": "下载视频", "description": "下载视频按钮文本" diff --git a/src/i18n/zh-CN/site.json b/src/i18n/zh-CN/site.json index 7833fcea..6d27ea14 100644 --- a/src/i18n/zh-CN/site.json +++ b/src/i18n/zh-CN/site.json @@ -63,6 +63,10 @@ "message": "Luma", "description": "展示在编辑框的标题" }, + "field.featuresHeadshots": { + "message": "AI证件照", + "description": "展示在编辑框的标题" + }, "field.featuresSuno": { "message": "Suno", "description": "展示在编辑框的标题" @@ -259,6 +263,10 @@ "message": "打开或关闭 Luma 功能模块。", "description": "Luma 功能的描述" }, + "message.featuresHeadshots": { + "message": "打开或关闭 AI证件照 功能模块。", + "description": "AI证件照 功能的描述" + }, "message.featuresSupport": { "message": "打开或关闭客服支持", "description": "Support 功能的描述" diff --git a/src/operators/headshots.ts b/src/operators/headshots.ts index 58347b91..2fb571d5 100644 --- a/src/operators/headshots.ts +++ b/src/operators/headshots.ts @@ -10,7 +10,7 @@ import { BASE_URL_API } from '@/constants'; class HeadshotsOperator { async task(id: string, options: { token: string }): Promise> { return await axios.post( - `/luma/tasks`, + `/headshots/tasks`, { action: 'retrieve', id: id @@ -32,7 +32,7 @@ class HeadshotsOperator { options: { token: string } ): Promise> { return await axios.post( - `/luma/tasks`, + `/headshots/tasks`, { action: 'retrieve_batch', ...(filter.ids @@ -79,7 +79,7 @@ class HeadshotsOperator { token: string; } ): Promise> { - return await axios.post('/luma/videos', data, { + return await axios.post('/headshots/generate', data, { headers: { authorization: `Bearer ${options.token}`, 'content-type': 'application/json',