mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-29 03:36:10 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
f5167ae895
3 changed files with 5 additions and 15 deletions
|
|
@ -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 日后删除 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)
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue