diff --git a/src/api/ai/chat/conversation/index.ts b/src/api/ai/chat/conversation/index.ts index 08ad26a1..9f5f70f2 100644 --- a/src/api/ai/chat/conversation/index.ts +++ b/src/api/ai/chat/conversation/index.ts @@ -43,8 +43,8 @@ export const ChatConversationApi = { }, // 删除【我的】所有对话,置顶除外 - deleteMyAllExceptPinned: async () => { - return await request.delete({ url: `/ai/chat/conversation/delete-my-all-except-pinned` }) + deleteChatConversationMyByUnpinned: async () => { + return await request.delete({ url: `/ai/chat/conversation/delete-by-unpinned` }) }, // 获得【我的】聊天对话列表 diff --git a/src/api/ai/image/index.ts b/src/api/ai/image/index.ts index 7c7130e8..496fac53 100644 --- a/src/api/ai/image/index.ts +++ b/src/api/ai/image/index.ts @@ -16,6 +16,7 @@ export interface ImageVO { taskId: number // 任务编号 buttons: ImageMjButtonsVO[] // mj 操作按钮 createTime: string // 创建时间 + finishTime: string // 完成时间 } export interface ImagePageReqVO { diff --git a/src/assets/ai/dall2.jpg b/src/assets/ai/dall2.jpg new file mode 100644 index 00000000..c07374dc Binary files /dev/null and b/src/assets/ai/dall2.jpg differ diff --git a/src/assets/ai/dall3.jpg b/src/assets/ai/dall3.jpg new file mode 100644 index 00000000..7f45803b Binary files /dev/null and b/src/assets/ai/dall3.jpg differ diff --git a/src/assets/ai/qingxi.jpg b/src/assets/ai/qingxi.jpg new file mode 100644 index 00000000..d76b8156 Binary files /dev/null and b/src/assets/ai/qingxi.jpg differ diff --git a/src/assets/ai/ziran.jpg b/src/assets/ai/ziran.jpg new file mode 100644 index 00000000..62907242 Binary files /dev/null and b/src/assets/ai/ziran.jpg differ diff --git a/src/utils/download.ts b/src/utils/download.ts index fe24ee27..4e8b8c60 100644 --- a/src/utils/download.ts +++ b/src/utils/download.ts @@ -29,10 +29,29 @@ const download = { html: (data: Blob, fileName: string) => { download0(data, fileName, 'text/html') }, - // 下载 MarkdownView 方法 + // 下载 Markdown 方法 markdown: (data: Blob, fileName: string) => { download0(data, fileName, 'text/markdown') } } export default download + +/** 图片下载(通过浏览器图片下载) */ +export const downloadImage = async (imageUrl) => { + const image = new Image() + image.setAttribute('crossOrigin', 'anonymous') + image.src = imageUrl + image.onload = () => { + const canvas = document.createElement('canvas') + canvas.width = image.width + canvas.height = image.height + const ctx = canvas.getContext('2d') as CanvasDrawImage + ctx.drawImage(image, 0, 0, image.width, image.height) + const url = canvas.toDataURL('image/png') + const a = document.createElement('a') + a.href = url + a.download = 'image.png' + a.click() + } +} diff --git a/src/views/ai/chat/Conversation.vue b/src/views/ai/chat/Conversation.vue index 2afeb9ac..5976171b 100644 --- a/src/views/ai/chat/Conversation.vue +++ b/src/views/ai/chat/Conversation.vue @@ -1,11 +1,10 @@