This commit is contained in:
Jesse-Ma
2023-03-30 10:19:18 +08:00
parent 0de98e660b
commit f369e59f6f
3 changed files with 75 additions and 35 deletions

View File

@@ -1,7 +1,7 @@
import axios from "axios";
import { getStoreKey } from "@/api/lock";
import storage from "@/libs/storage";
import { md5, wrap} from "@/libs/secret";
import { md5, wrap,convertBase64ToHexString,convertHexStringToUint8Array} from "@/libs/secret";
import NoteConstant from "@/libs/constants";
axios.interceptors.response.use(undefined, (err) => {
@@ -51,8 +51,11 @@ export function saveNote(noteForm, secret) {
// let bufferArrary = eval("[" + note.text + "]");
// let array = Uint8Array.from(bufferArrary);
let encoder = new TextEncoder()
let array = encoder.encode(note.text)
// let encoder = new TextEncoder()
// let array = encoder.encode(note.text)
let hexString = convertBase64ToHexString(note.text)
let array = convertHexStringToUint8Array(hexString)
let blob = new Blob([array], { type: "application/octet-stream" });
let form = new FormData();