🎨 localStorage 支持在多界面实例间同步 https://github.com/siyuan-note/siyuan/issues/6965

This commit is contained in:
Liang Ding 2023-01-01 13:56:10 +08:00
parent 3a1382cb42
commit 853ba5be3a
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
5 changed files with 38 additions and 10 deletions

View file

@ -188,11 +188,16 @@ func setLocalStorage(c *gin.Context) {
}
val := arg["val"].(interface{})
err := model.SetLocalStorage(val)
if nil != err {
ret.Code = -1
ret.Msg = err.Error()
return
}
app := arg["app"].(string)
evt := util.NewCmdResult("transactions", 0, util.PushModeBroadcastMainExcludeSelfApp, util.PushModeBroadcastMainExcludeSelfApp)
evt.AppId = app
evt.Data = val
util.PushEvent(evt)
}