mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 00:20:12 +01:00
This commit is contained in:
parent
c7b43df2d8
commit
1e04a4aa07
1 changed files with 5 additions and 1 deletions
|
|
@ -6,7 +6,7 @@ import {isMobile, isWindow} from "../util/functions";
|
||||||
export class Plugin {
|
export class Plugin {
|
||||||
public i18n: IObject;
|
public i18n: IObject;
|
||||||
public eventBus: EventBus;
|
public eventBus: EventBus;
|
||||||
public data: any = {};
|
public data: any;
|
||||||
public name: string;
|
public name: string;
|
||||||
|
|
||||||
constructor(options: {
|
constructor(options: {
|
||||||
|
|
@ -52,6 +52,9 @@ export class Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
public loadData(storageName: string) {
|
public loadData(storageName: string) {
|
||||||
|
if (!this.data) {
|
||||||
|
this.data = {}
|
||||||
|
}
|
||||||
if (typeof this.data[storageName] === "undefined") {
|
if (typeof this.data[storageName] === "undefined") {
|
||||||
this.data[storageName] = "";
|
this.data[storageName] = "";
|
||||||
}
|
}
|
||||||
|
|
@ -76,6 +79,7 @@ export class Plugin {
|
||||||
formData.append('file', file);
|
formData.append('file', file);
|
||||||
formData.append('isDir', "false");
|
formData.append('isDir', "false");
|
||||||
fetchPost("/api/file/putFile", formData, (response) => {
|
fetchPost("/api/file/putFile", formData, (response) => {
|
||||||
|
this.data[storageName] = data;
|
||||||
resolve(response);
|
resolve(response);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue