From 89c00330d4a35c2913e7179f8745b6a94e7d2794 Mon Sep 17 00:00:00 2001 From: zxstty Date: Tue, 23 Sep 2025 16:04:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=9A=84=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=90=8D=E4=B8=BAopenEuler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/main.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/apps/main.py b/apps/main.py index a7662062..11c32a4b 100644 --- a/apps/main.py +++ b/apps/main.py @@ -89,14 +89,9 @@ async def add_defaut_admin_user()->None: """ from apps.common.mongo import MongoDB from apps.schemas.collection import User - import os mongo = MongoDB() user_collection = mongo.get_collection("user") - username = os.environ.get('USERNAME') # 适用于 Windows 系统 - if not username: - username = os.environ.get('USER') # 适用于 Linux 和 macOS 系统 - if not username: - username = "admin" + username = "openEuler" try: await user_collection.insert_one(User( _id=username, -- Gitee