diff --git a/code-server-like/app/views/file.py b/code-server-like/app/views/file.py index d5f5051..d91baa1 100644 --- a/code-server-like/app/views/file.py +++ b/code-server-like/app/views/file.py @@ -152,10 +152,11 @@ def save_file(): @file_bp.route('/file-tree', methods=['GET']) def file_tree(): path = session.get('path') + user_id = session.get('user_id') if not path: return jsonify({"error": "Missing path parameter"}), 400 root_workspace_path = current_app.config['ROOT_WORKSPACE_PATH'] - base_path = f'{root_workspace_path}/{path}' + base_path = f'{root_workspace_path}/{user_id}/{path}' if not os.path.exists(base_path): return jsonify({"error": "Workspace not found"}), 404 tree = get_file_tree(base_path)