Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/5066 storage

Vanessa1e04a4aa07e2
diff --git a/app/src/plugin/index.ts b/app/src/plugin/index.ts
index a2ef641e4f..ade4a9a158 100644
--- a/app/src/plugin/index.ts
+++ b/app/src/plugin/index.ts
@@ -6,7 +6,7 @@ import {isMobile, isWindow} from "../util/functions";
export class Plugin {
public i18n: IObject;
public eventBus: EventBus;
- public data: any = {};
+ public data: any;
public name: string;
constructor(options: {
@@ -52,6 +52,9 @@ export class Plugin {
}
public loadData(storageName: string) {
+ if (!this.data) {
+ this.data = {}
+ }
if (typeof this.data[storageName] === "undefined") {
this.data[storageName] = "";
}
@@ -76,6 +79,7 @@ export class Plugin {
formData.append('file', file);
formData.append('isDir', "false");
fetchPost("/api/file/putFile", formData, (response) => {
+ this.data[storageName] = data;
resolve(response);
});
});