diff --git a/.gitignore b/.gitignore index f104bec..3e1789e 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ internal/static/dist/ # Config (sensitive) configs/config.local.json +# Python +__pycache__/ + # Misc -*.log -*.tmp diff --git a/internal/controllers/file_controller.go b/internal/controllers/file_controller.go index 260510d..0f3d58c 100644 --- a/internal/controllers/file_controller.go +++ b/internal/controllers/file_controller.go @@ -53,6 +53,11 @@ func (fc *FileController) GetFileTree(c *gin.Context) { return nil } + // 过滤 __pycache__ 文件夹 + if d.IsDir() && d.Name() == "__pycache__" { + return filepath.SkipDir + } + relPath, _ := filepath.Rel(fc.workDir, path) parts := strings.Split(relPath, string(filepath.Separator)) @@ -234,7 +239,7 @@ func (fc *FileController) RenameFile(c *gin.Context) { // UploadArchive handles archive file upload and extraction func (fc *FileController) UploadArchive(c *gin.Context) { targetDir := c.PostForm("path") - + file, err := c.FormFile("file") if err != nil { utils.BadRequest(c, "请选择文件") diff --git a/web/src/views/editor/Editor.vue b/web/src/views/editor/Editor.vue index 1ce954a..90097f2 100644 --- a/web/src/views/editor/Editor.vue +++ b/web/src/views/editor/Editor.vue @@ -410,7 +410,8 @@ onUnmounted(() => { formatOnPaste: true, tabSize: 4, insertSpaces: true, - readOnly: !isEditMode + readOnly: !isEditMode, + domReadOnly: !isEditMode }" />