diff --git a/kernel/api/filetree.go b/kernel/api/filetree.go index ea0ec6bd8..7132597ed 100644 --- a/kernel/api/filetree.go +++ b/kernel/api/filetree.go @@ -971,21 +971,9 @@ func getShorthandSavePath(c *gin.Context) { } notebook := arg["notebook"].(string) - box := model.Conf.Box(notebook) - var shorthandSaveBox string + shorthandSaveBox := model.Conf.FileTree.ShorthandSaveBox shorthandSavePathTpl := model.Conf.FileTree.ShorthandSavePath - if nil != box { - boxConf := box.GetConf() - shorthandSaveBox = boxConf.ShorthandSaveBox - shorthandSavePathTpl = boxConf.ShorthandSavePath - } - if "" == shorthandSaveBox { - shorthandSaveBox = model.Conf.FileTree.ShorthandSaveBox - } - if "" == shorthandSavePathTpl { - shorthandSavePathTpl = model.Conf.FileTree.ShorthandSavePath - } if "" == shorthandSaveBox { shorthandSaveBox = notebook diff --git a/kernel/api/notebook.go b/kernel/api/notebook.go index c5099de21..71ddc8334 100644 --- a/kernel/api/notebook.go +++ b/kernel/api/notebook.go @@ -411,13 +411,6 @@ func setNotebookConf(c *gin.Context) { boxConf.DocCreateSavePath = util.TrimSpaceInPath(boxConf.DocCreateSavePath) - boxConf.ShorthandSavePath = util.TrimSpaceInPath(boxConf.ShorthandSavePath) - if "" != boxConf.ShorthandSavePath { - if !strings.HasPrefix(boxConf.ShorthandSavePath, "/") { - boxConf.ShorthandSavePath = "/" + boxConf.ShorthandSavePath - } - } - box.SaveConf(boxConf) ret.Data = boxConf } diff --git a/kernel/conf/box.go b/kernel/conf/box.go index eeb8647e3..c79257af2 100644 --- a/kernel/conf/box.go +++ b/kernel/conf/box.go @@ -30,8 +30,6 @@ type BoxConf struct { DocCreateSavePath string `json:"docCreateSavePath"` // 新建文档存储路径 DailyNoteSavePath string `json:"dailyNoteSavePath"` // 新建日记存储路径 DailyNoteTemplatePath string `json:"dailyNoteTemplatePath"` // 新建日记使用的模板路径 - ShorthandSaveBox string `json:"shorthandSaveBox"` // 闪念速记存储笔记本 - ShorthandSavePath string `json:"shorthandSavePath"` // 闪念速记存储路径 SortMode int `json:"sortMode"` // 排序方式 } diff --git a/kernel/model/shortcuts.go b/kernel/model/shortcuts.go index eda96be11..8b0d73390 100644 --- a/kernel/model/shortcuts.go +++ b/kernel/model/shortcuts.go @@ -68,15 +68,7 @@ func MoveLocalShorthands(boxID string) (retIDs []string, err error) { } } - var hPath string - box := Conf.Box(boxID) - if nil != box { - boxConf := box.GetConf() - hPath = boxConf.ShorthandSavePath - } - if "" == hPath { - hPath = Conf.FileTree.ShorthandSavePath - } + hPath := Conf.FileTree.ShorthandSavePath if "" != hPath { var renderErr error hPath, renderErr = RenderGoTemplate(hPath) @@ -202,6 +194,7 @@ func MoveLocalShorthands(boxID string) (retIDs []string, err error) { } FlushTxQueue() + box := Conf.Box(boxID) for _, id := range retIDs { b, _ := GetBlock(id, nil) PushCreate(box, b.Path, nil)