opt:Optimize the algorithm to check whether Midjourney images can continue to variation

This commit is contained in:
RockYang
2023-08-17 14:20:16 +08:00
parent 2964c1d82e
commit 08d8d65599
11 changed files with 31 additions and 30 deletions

View File

@@ -534,7 +534,7 @@ const connect = function (chat_id, role_id) {
} else { // 加载聊天记录
loadChatHistory(chat_id);
}
});
_socket.addEventListener('message', event => {
@@ -554,7 +554,7 @@ const connect = function (chat_id, role_id) {
disableInput(true)
const content = data.content;
const md = require('markdown-it')({breaks: true});
content.content = md.render(content.content)
content.html = md.render(content.content)
let key = content.key
// fixed bug: 执行 Upscale 和 Variation 操作的时候覆盖之前的绘画
if (content.status === "Finished") {
@@ -773,7 +773,7 @@ const loadChatHistory = function (chatId) {
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)
data[i].content.html = md.render(data[i].content?.content)
chatData.value.push(data[i]);
continue;
}

View File

@@ -52,7 +52,6 @@ import {onMounted, ref} from "vue";
import {Lock, UserFilled} from "@element-plus/icons-vue";
import {httpPost} from "@/utils/http";
import {ElMessage} from "element-plus";
import {setSessionId} from "@/store/session";
import {useRouter} from "vue-router";
import FooterBar from "@/components/FooterBar.vue";
import {isMobile} from "@/utils/libs";
@@ -78,8 +77,7 @@ const login = function () {
return ElMessage.error('请输入密码');
}
httpPost('/api/user/login', {username: username.value.trim(), password: password.value.trim()}).then((res) => {
setSessionId(res.data)
httpPost('/api/user/login', {username: username.value.trim(), password: password.value.trim()}).then(() => {
if (isMobile()) {
router.push('/mobile')
} else {