From d1b62c1b3ea9f20cadfd881f3a07ce474984f45f Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sun, 28 Dec 2025 22:13:20 +0800 Subject: [PATCH 1/3] :art: https://github.com/siyuan-note/siyuan/issues/16664#issuecomment-3694774305 Signed-off-by: Daniel <845765@qq.com> --- kernel/api/router.go | 2 +- kernel/api/storage.go | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/kernel/api/router.go b/kernel/api/router.go index 203974111..873752933 100644 --- a/kernel/api/router.go +++ b/kernel/api/router.go @@ -70,7 +70,7 @@ func ServeAPI(ginServer *gin.Engine) { ginServer.Handle("POST", "/api/system/vacuumDataIndex", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, vacuumDataIndex) ginServer.Handle("POST", "/api/system/rebuildDataIndex", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, rebuildDataIndex) - ginServer.Handle("POST", "/api/storage/setLocalStorage", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, setLocalStorage) + ginServer.Handle("POST", "/api/storage/setLocalStorage", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, setLocalStorage) // TODO 请使用 /api/storage/setLocalStorageVal,该端点计划于 2026 年 6 月 30 日后删除 ginServer.Handle("POST", "/api/storage/getLocalStorage", model.CheckAuth, getLocalStorage) ginServer.Handle("POST", "/api/storage/setLocalStorageVal", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, setLocalStorageVal) ginServer.Handle("POST", "/api/storage/removeLocalStorageVals", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, removeLocalStorageVals) diff --git a/kernel/api/storage.go b/kernel/api/storage.go index 1cfe617a8..4c20087f6 100644 --- a/kernel/api/storage.go +++ b/kernel/api/storage.go @@ -21,7 +21,6 @@ import ( "github.com/88250/gulu" "github.com/gin-gonic/gin" - "github.com/siyuan-note/logging" "github.com/siyuan-note/siyuan/kernel/model" "github.com/siyuan-note/siyuan/kernel/util" ) @@ -177,19 +176,6 @@ func setLocalStorage(c *gin.Context) { ret.Msg = err.Error() return } - - if arg["app"] == nil { - logging.LogErrorf("app is nil in setLocalStorage") - ret.Code = -1 - ret.Msg = "arg [app] is nil" - return - } - - app := arg["app"].(string) - evt := util.NewCmdResult("setLocalStorage", 0, util.PushModeBroadcastMainExcludeSelfApp) - evt.AppId = app - evt.Data = val - util.PushEvent(evt) } func getLocalStorage(c *gin.Context) { From 7dc84e5447f8878d0dfe377a1540507d05141a86 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sun, 28 Dec 2025 22:13:29 +0800 Subject: [PATCH 2/3] :art: https://github.com/siyuan-note/siyuan/issues/16664#issuecomment-3694774305 Signed-off-by: Daniel <845765@qq.com> --- kernel/api/router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/api/router.go b/kernel/api/router.go index 873752933..d36fe83a6 100644 --- a/kernel/api/router.go +++ b/kernel/api/router.go @@ -70,7 +70,7 @@ func ServeAPI(ginServer *gin.Engine) { ginServer.Handle("POST", "/api/system/vacuumDataIndex", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, vacuumDataIndex) ginServer.Handle("POST", "/api/system/rebuildDataIndex", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, rebuildDataIndex) - ginServer.Handle("POST", "/api/storage/setLocalStorage", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, setLocalStorage) // TODO 请使用 /api/storage/setLocalStorageVal,该端点计划于 2026 年 6 月 30 日后删除 + ginServer.Handle("POST", "/api/storage/setLocalStorage", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, setLocalStorage) // TODO 请使用 /api/storage/setLocalStorageVal,该端点计划于 2026 年 6 月 30 日后删除 https://github.com/siyuan-note/siyuan/issues/16664#issuecomment-3694774305 ginServer.Handle("POST", "/api/storage/getLocalStorage", model.CheckAuth, getLocalStorage) ginServer.Handle("POST", "/api/storage/setLocalStorageVal", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, setLocalStorageVal) ginServer.Handle("POST", "/api/storage/removeLocalStorageVals", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, removeLocalStorageVals) From 1c760a84d98d16e5afa8f1c5ecf3c251899675f5 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sun, 28 Dec 2025 22:16:19 +0800 Subject: [PATCH 3/3] :art: https://github.com/siyuan-note/siyuan/issues/16688#issuecomment-3694706501 Signed-off-by: Daniel <845765@qq.com> --- kernel/model/plugin.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/model/plugin.go b/kernel/model/plugin.go index 0b4947a55..4436627b3 100644 --- a/kernel/model/plugin.go +++ b/kernel/model/plugin.go @@ -111,6 +111,10 @@ func LoadPetals(frontend string, isPublish bool) (ret []*Petal) { for _, petal := range petals { _, petal.DisplayName, petal.Incompatible, petal.DisabledInPublish, petal.DisallowInstall = bazaar.ParseInstalledPlugin(petal.Name, frontend) if !petal.Enabled || petal.Incompatible || (isPublish && petal.DisabledInPublish) || petal.DisallowInstall { + if petal.DisallowInstall { + SetPetalEnabled(petal.Name, false, frontend) + logging.LogInfof("plugin [%s] disallowed install, auto disabled", petal.Name) + } continue }