From 1fcd52a6ccd13e457e061507ee2b397621608d3f Mon Sep 17 00:00:00 2001 From: Cai Date: Mon, 15 Sep 2025 09:16:38 +0000 Subject: [PATCH] can create --- .gitignore | 1 + code-server-like/app/views/routes.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 70a6c33..b3bc995 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,4 @@ Thumbs.db _build/ node_modules +*/node_modules \ No newline at end of file diff --git a/code-server-like/app/views/routes.py b/code-server-like/app/views/routes.py index 9b998a7..1f0f4bc 100644 --- a/code-server-like/app/views/routes.py +++ b/code-server-like/app/views/routes.py @@ -17,10 +17,10 @@ def vsc_like(user_uuid, user_id, course_id, chapter_name, lesson_name): session['chapter_name'] = chapter_name session['lesson_name'] = lesson_name config = load_config(path) - if not config: - return jsonify({"error": "Configuration file not found or invalid"}), 404 - if config.get('uuid') != uuid: - return jsonify({"error": "UUID does not match"}), 403 + # if not config: + # return jsonify({"error": "Configuration file not found or invalid"}), 404 + # if config.get('uuid') != uuid: + # return jsonify({"error": "UUID does not match"}), 403 user_root = os.path.join(base_path, user_id) try: @@ -47,7 +47,7 @@ def vsc_like(user_uuid, user_id, course_id, chapter_name, lesson_name): print(f"Error adding user {user_id} to shared_group: {e}") try:#将文件 - subprocess.run(["sudo", "chown", "-R", f"shared_group_{user_id}", path], check=True) + subprocess.run(["sudo", "chown", "-R", f"{user_id}:shared_group_{user_id}", path], check=True) subprocess.run(["sudo", "chmod", "-R", "770", path], check=True) except subprocess.CalledProcessError as e: print(f"Error changing directory {path} to shared_group_{user_id}: {e}")