🎨 Prompt when the user attempts to create a workspace in the root directory of the disk https://github.com/siyuan-note/siyuan/issues/15976

Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2025-09-29 11:34:24 +08:00
parent 89fe4fc560
commit 33216b093d
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -52,6 +52,7 @@ func checkWorkspaceDir(c *gin.Context) {
} }
// 检查路径是否包含其他文件 // 检查路径是否包含其他文件
if !util.IsWorkspaceDir(path) {
entries, err := os.ReadDir(path) entries, err := os.ReadDir(path)
if err != nil { if err != nil {
ret.Code = -1 ret.Code = -1
@ -64,6 +65,7 @@ func checkWorkspaceDir(c *gin.Context) {
ret.Data = map[string]interface{}{"closeTimeout": 7000} ret.Data = map[string]interface{}{"closeTimeout": 7000}
return return
} }
}
if isInvalidWorkspacePath(path) { if isInvalidWorkspacePath(path) {
ret.Code = -1 ret.Code = -1