👍️[Update] Model : tauri -> python のデータ部分をbase64でencodeするように修正

This commit is contained in:
misyaguziya
2024-09-03 14:47:22 +09:00
parent 87d2ecef34
commit fb0a4a8f26
7 changed files with 17 additions and 17 deletions

View File

@@ -7,14 +7,13 @@ import { useStdoutToPython } from "./useStdoutToPython";
export const useMessage = () => {
const { currentMessageLogsStatus, addMessageLogsStatus, updateMessageLogsStatus } = useMessageLogsStatus();
const { asyncStdoutToPython } = useStdoutToPython();
const encoder = new TextEncoder();
return {
sendMessage: (message) => {
const uuid = crypto.randomUUID();
const send_message_object = {
id: uuid,
message: encoder.encode(message),
message: message,
};
asyncStdoutToPython("/controller/callback_messagebox_send", send_message_object);

View File

@@ -1,9 +1,10 @@
import { store } from "@store";
import { encode } from 'js-base64'
export const useStdoutToPython = () => {
const asyncStdoutToPython = async (path, value) => {
let send_object = { endpoint: path };
if (value) send_object.data = value;
if (value) send_object.data = encode(value);
// send to python
const backend_subprocess = store.backend_subprocess;