Browse Source

:art: 移动端支持多工作空间 Fix https://github.com/siyuan-note/siyuan/issues/4642

Liang Ding 2 years ago
parent
commit
dae28aacb0
1 changed files with 5 additions and 4 deletions
  1. 5 4
      kernel/api/workspace.go

+ 5 - 4
kernel/api/workspace.go

@@ -45,14 +45,15 @@ func createWorkspaceDir(c *gin.Context) {
 	absPath := arg["path"].(string)
 	absPath := arg["path"].(string)
 	absPath = gulu.Str.RemoveInvisible(absPath)
 	absPath = gulu.Str.RemoveInvisible(absPath)
 	absPath = strings.TrimSpace(absPath)
 	absPath = strings.TrimSpace(absPath)
-	if gulu.File.IsExist(absPath) {
+	if isInvalidWorkspacePath(absPath) {
 		ret.Code = -1
 		ret.Code = -1
-		ret.Msg = model.Conf.Language(78)
+		ret.Msg = "This workspace name is not allowed, please use another name"
 		return
 		return
 	}
 	}
-	if isInvalidWorkspacePath(absPath) {
+
+	if gulu.File.IsExist(absPath) {
 		ret.Code = -1
 		ret.Code = -1
-		ret.Msg = "This workspace name is not allowed, please use another name"
+		ret.Msg = model.Conf.Language(78)
 		return
 		return
 	}
 	}