mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 新增内核 API localStorage https://github.com/siyuan-note/siyuan/issues/6960
This commit is contained in:
parent
6a2205fb3b
commit
3a1382cb42
2 changed files with 0 additions and 85 deletions
44
API_zh_CN.md
44
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": {}
|
||||
}
|
||||
```
|
||||
|
||||
## 系统
|
||||
|
||||
### 获取启动进度
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue