This commit is contained in:
Daniel 2025-02-10 11:00:03 +08:00
parent e01b7256b5
commit 010139be3f
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 21 additions and 1 deletions

View file

@ -300,7 +300,7 @@ func setWorkspaceDir(c *gin.Context) {
// 检查路径是否在已有的工作空间路径中
pathIsWorkspace := util.IsWorkspaceDir(path)
if !pathIsWorkspace {
for p := filepath.Dir(path); "" != p; p = filepath.Dir(p) {
for p := filepath.Dir(path); !util.IsRootPath(p); p = filepath.Dir(p) {
if util.IsWorkspaceDir(p) {
ret.Code = -1
ret.Msg = fmt.Sprintf(model.Conf.Language(256), path, p)