Skip to content

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

:art: 新增内核 API `localStorage` https://github.com/siyuan-note/siyuan/issues/6960

Liang Ding3a1382cb42cb
diff --git a/API.md b/API.md
index 2979e61593..256091d82c 100644
--- a/API.md
+++ b/API.md
@@ -950,47 +950,6 @@ View API token in <kbd>Settings - About</kbd>, request header: `Authorization: T
```
* `id`:Message ID
-## Storage
-
-### Set localStorage
-
-This API is similar to the browser's `localStorage.setItem`, but the setting parameter is the entire JSON-formatted data instead of a single key-value pair.
-
-When developing front-end extensions, you should avoid using the browser's `localStorage`, because using the browser's `localStorage` directly will cause data to be incorrectly overwritten or lost when switching between multiple workspaces.
-
-* `/api/storage/setLocalStorage`
-* Parameters
-
- ```json
- {
- "val": {}
- }
- ```
-
-* Return value
-
- ```json
- {
- "code": 0,
- "msg": "",
- "data": null
- }
- ```
-
-### Get localStorage
-
-* `/api/storage/getLocalStorage`
-* No parameters
-* Return value
-
- ```json
- {
- "code": 0,
- "msg": "",
- "data": {}
- }
- ```
-
## System
### Get boot progress
diff --git a/API_zh_CN.md b/API_zh_CN.md
index fbff27efc2..61ccf9a2ee 100644
--- a/API_zh_CN.md
+++ b/API_zh_CN.md
@@ -43,9 +43,6 @@
* [通知](#通知)
* [推送消息](#推送消息)
* [推送报错消息](#推送报错消息)
-* [存储](#存储)
- * [设置 localStorage](#设置-localStorage)
- * [获取 localStorage](#获取-localStorage)
* [系统](#系统)
* [获取启动进度](#获取启动进度)
* [获取系统版本](#获取系统版本)
@@ -947,47 +944,6 @@
```
* `id`:消息 ID
-## 存储
-
-### 设置 localStorage
-
-该 API 类似浏览器的 `localStorage.setItem`,但是设置参数是整个 JSON 格式的数据,而不是单个键值对。
-
-前端开发扩展时应该避免使用浏览器的 `localStorage`,因为直接使用浏览器的 `localStorage` 会导致多工作空间切换时数据错误覆盖或丢失。
-
-* `/api/storage/setLocalStorage`
-* 参数
-
- ```json
- {
- "val": {}
- }
- ```
-
-* 返回值
-
- ```json
- {
- "code": 0,
- "msg": "",
- "data": null
- }
- ```
-
-### 获取 localStorage
-
-* `/api/storage/getLocalStorage`
-* 无参数
-* 返回值
-
- ```json
- {
- "code": 0,
- "msg": "",
- "data": {}
- }
- ```
-
## 系统
### 获取启动进度