This commit is contained in:
Jesse-Ma
2022-06-06 10:56:12 +08:00
parent 0d10a1802a
commit 9a7d98316c
11 changed files with 392 additions and 50 deletions

View File

@@ -4,12 +4,13 @@ import {getStoreKey} from "@/api/lock";
import storage from "@/libs/storage";
export function saveNote(noteForm) {
let storeKey = getStoreKey(noteForm.key);
let storeText = storage.local.getText(storeKey + '.text');
let note = {
"lock": storeText.substring(0, 1),
"text": storeText.substring(35)
"cipher": storeText.substring(2, 34),
"text": storeText.substring(35),
"key": noteForm.key
}
console.log("n"+ storeText)
@@ -23,6 +24,22 @@ export function saveNote(noteForm) {
)
}
export function deleteNote(key) {
let storeKey = getStoreKey(key);
let storeText = storage.local.getText(storeKey + '.text');
let note = {
"cipher": storeText.substring(2, 34),
"key": key
}
return axios({
url: '/note/' + key +'/delete',
method: 'post',
data: note
}
)
}
// export function getSecretKey(key, password) {
// console.log("getSecretKey");
// let secretKey = '';