add path userid

This commit is contained in:
CakeCN
2025-09-15 20:00:34 +08:00
parent bb7fd32fde
commit 52029a1939

View File

@@ -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)