feat: midjourney drawing image function is ready

This commit is contained in:
RockYang
2023-08-14 17:59:21 +08:00
parent 373370fde5
commit 6c76086916
13 changed files with 357 additions and 30 deletions

View File

@@ -22,6 +22,10 @@
:created-at="dateFormat(item['created_at'])"
:tokens="item['tokens']"
:content="item.content"/>
<chat-mid-journey v-else-if="item.type==='mj'"
:content="item.content"
:icon="item.icon"
:created-at="dateFormat(item['created_at'])"/>
</div>
</div><!-- end chat box -->
</div>
@@ -38,6 +42,7 @@ import 'highlight.js/styles/a11y-dark.css'
import hl from "highlight.js";
import {ElMessage} from "element-plus";
import {Promotion} from "@element-plus/icons-vue";
import ChatMidJourney from "@/components/ChatMidJourney.vue";
const chatData = ref([])
const router = useRouter()
@@ -57,6 +62,11 @@ httpGet('/api/chat/history?chat_id=' + chatId).then(res => {
if (data[i].type === "prompt") {
chatData.value.push(data[i]);
continue;
} else if (data[i].type === "mj") {
data[i].content = JSON.parse(data[i].content)
data[i].content.content = md.render(data[i].content?.content)
chatData.value.push(data[i]);
continue;
}
data[i].orgContent = data[i].content;