This commit is contained in:
Jesse-Ma
2022-07-29 15:21:20 +08:00
parent deb1fbe49d
commit 732907c3b6
22 changed files with 592 additions and 415 deletions

View File

@@ -3,6 +3,8 @@ import Jquery from "jquery";
import {getStoreKey} from "@/api/lock";
import storage from "@/libs/storage";
const servicePath = 'https://service.flagnote.com';
export function saveNote(noteForm) {
let storeKey = getStoreKey(noteForm.key);
let storeText = storage.local.getText(storeKey + '.text');
@@ -14,7 +16,7 @@ export function saveNote(noteForm) {
}
return axios({
url: '/note/' + noteForm.key,
url: servicePath+'/note/' + noteForm.key,
method: 'post',
data: note
}
@@ -30,7 +32,7 @@ export function deleteNote(key) {
}
return axios({
url: '/note/' + key +'/delete',
url: servicePath+'/note/' + key +'/delete',
method: 'post',
data: note
}
@@ -62,7 +64,7 @@ export function getNoteMeta(key) {
let noteMeta = {};
Jquery.ajax({
method: 'GET',
url: '/note/' + key + "/noteMeta",
url: servicePath+'/note/' + key + "/noteMeta",
async: false,
success: function (data) {
noteMeta = eval(data); //eval("(" + data + ")");
@@ -74,11 +76,27 @@ export function getNoteMeta(key) {
return noteMeta;
}
export function getNote(key) {
let noteObject = {};
Jquery.ajax({
method: 'GET',
url: servicePath + '/note/' + key,
async: false,
success: function (data) {
noteObject = eval(data);
},
error: function () {
noteObject = null;
},
});
return noteObject;
}
export function getKeyMeta() {
let keyMeta = {};
Jquery.ajax({
method: 'GET',
url: '/note/keyMeta',
url: servicePath+'/note/keyMeta',
async: false,
success: function (data) {
keyMeta = eval(data); //eval("(" + data + ")");