🎨 移动端支持多工作空间 Fix https://github.com/siyuan-note/siyuan/issues/4642
This commit is contained in:
parent
43cc09af8d
commit
dae28aacb0
1 changed files with 6 additions and 5 deletions
|
@ -45,17 +45,18 @@ func createWorkspaceDir(c *gin.Context) {
|
|||
absPath := arg["path"].(string)
|
||||
absPath = gulu.Str.RemoveInvisible(absPath)
|
||||
absPath = strings.TrimSpace(absPath)
|
||||
if gulu.File.IsExist(absPath) {
|
||||
ret.Code = -1
|
||||
ret.Msg = model.Conf.Language(78)
|
||||
return
|
||||
}
|
||||
if isInvalidWorkspacePath(absPath) {
|
||||
ret.Code = -1
|
||||
ret.Msg = "This workspace name is not allowed, please use another name"
|
||||
return
|
||||
}
|
||||
|
||||
if gulu.File.IsExist(absPath) {
|
||||
ret.Code = -1
|
||||
ret.Msg = model.Conf.Language(78)
|
||||
return
|
||||
}
|
||||
|
||||
if err := os.MkdirAll(absPath, 0755); nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = fmt.Sprintf("create workspace dir [%s] failed: %s", absPath, err)
|
||||
|
|
Loading…
Add table
Reference in a new issue