mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
🎨 改进判断工作空间路径实现 Fix https://github.com/siyuan-note/siyuan/issues/7569
This commit is contained in:
parent
0f15fd2550
commit
3c9e80b411
2 changed files with 9 additions and 7 deletions
|
|
@ -198,8 +198,10 @@ func setWorkspaceDir(c *gin.Context) {
|
|||
}
|
||||
|
||||
if gulu.OS.IsWindows() {
|
||||
installDir := filepath.Dir(util.WorkingDir)
|
||||
if strings.HasPrefix(path, installDir) {
|
||||
// 改进判断工作空间路径实现 https://github.com/siyuan-note/siyuan/issues/7569
|
||||
installDirLower := strings.ToLower(filepath.Dir(util.WorkingDir))
|
||||
pathLower := strings.ToLower(path)
|
||||
if strings.HasPrefix(pathLower, installDirLower) && util.IsSubPath(installDirLower, pathLower) {
|
||||
ret.Code = -1
|
||||
ret.Msg = model.Conf.Language(98)
|
||||
ret.Data = map[string]interface{}{"closeTimeout": 5000}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue