👍️[Update] Model : tauri -> python のデータ部分をbase64でencodeするように修正
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user