mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 持久化 localStorage https://github.com/siyuan-note/siyuan/issues/6404
This commit is contained in:
parent
a97231b493
commit
33fa1700f8
1 changed files with 1 additions and 9 deletions
|
|
@ -168,13 +168,6 @@ func getLocalStorage(c *gin.Context) {
|
||||||
ret := gulu.Ret.NewResult()
|
ret := gulu.Ret.NewResult()
|
||||||
defer c.JSON(http.StatusOK, ret)
|
defer c.JSON(http.StatusOK, ret)
|
||||||
|
|
||||||
arg, ok := util.JsonArg(c, ret)
|
|
||||||
if !ok {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
key := arg["key"].(string)
|
|
||||||
|
|
||||||
lsPath := filepath.Join(util.DataDir, "storage/local.json")
|
lsPath := filepath.Join(util.DataDir, "storage/local.json")
|
||||||
if !gulu.File.IsExist(lsPath) {
|
if !gulu.File.IsExist(lsPath) {
|
||||||
return
|
return
|
||||||
|
|
@ -194,8 +187,7 @@ func getLocalStorage(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
value := ls[key]
|
ret.Data = ls
|
||||||
ret.Data = value
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func setLocalStorage(c *gin.Context) {
|
func setLocalStorage(c *gin.Context) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue