suspend
This commit is contained in:
@@ -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 } from "@/libs/secret";
|
||||
import NoteConstant from "@/libs/constants";
|
||||
|
||||
axios.interceptors.response.use(undefined, (err) => {
|
||||
@@ -17,10 +17,10 @@ axios.interceptors.response.use(undefined, (err) => {
|
||||
}
|
||||
});
|
||||
|
||||
export function saveNote(noteForm, secret) {
|
||||
export async function saveNote(noteForm, secret) {
|
||||
let storeKey = secret.storeKey;
|
||||
|
||||
let storeInfo = storage.local.getText(storeKey);
|
||||
const storeInfo = await storage.local.getText(storeKey);
|
||||
let starray = storeInfo.split("|");
|
||||
|
||||
if (starray[2] == "1") {
|
||||
@@ -71,14 +71,13 @@ export function saveNote(noteForm, secret) {
|
||||
});
|
||||
}
|
||||
|
||||
export function deleteNote(key) {
|
||||
export async function deleteNote(key) {
|
||||
let storeKey = getStoreKey(key);
|
||||
let storeInfo = storage.local.getText(storeKey);
|
||||
const storeInfo = await storage.local.getText(storeKey);
|
||||
let note = {
|
||||
cipher: storeInfo.substring(2, 34),
|
||||
key: key,
|
||||
};
|
||||
|
||||
return axios({
|
||||
url: NoteConstant.servicePath + "/note/" + key + "/delete",
|
||||
method: "post",
|
||||
@@ -97,6 +96,28 @@ export function getNoteBlob(key) {
|
||||
});
|
||||
}
|
||||
|
||||
export function getNoteMetaNew(key) {
|
||||
let url = NoteConstant.servicePath + "/note/" + key + "/noteMeta";
|
||||
return axios({
|
||||
url: url,
|
||||
method: "get",
|
||||
ignoreError: 1,
|
||||
original: true,
|
||||
source: true,
|
||||
});
|
||||
}
|
||||
|
||||
export function getKeyMetaNew() {
|
||||
let url = NoteConstant.servicePath + "/note/keyMeta";
|
||||
return axios({
|
||||
url: url,
|
||||
method: "get",
|
||||
ignoreError: 1,
|
||||
original: true,
|
||||
source: true,
|
||||
});
|
||||
}
|
||||
|
||||
export function getNoteMeta(key) {
|
||||
let url = NoteConstant.servicePath + "/note/" + key + "/noteMeta";
|
||||
let noteMeta = null;
|
||||
@@ -137,4 +158,4 @@ export function ajaxGet(url) {
|
||||
};
|
||||
xmlhttp.send();
|
||||
return data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user