From b1dd010c7f05588eadf2c09200488e3d464192a2 Mon Sep 17 00:00:00 2001 From: XIE7654 <765462425@qq.com> Date: Tue, 2 Sep 2025 17:50:32 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=20location=5Finfo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/Dockerfile | 2 +- backend/system/views/user.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 1b44c28..68ea085 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -16,7 +16,7 @@ COPY . . RUN pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple # 入口命令由 docker-compose 控制 # 数据库迁移 -RUN python manage.py migrate +#RUN python manage.py migrate # 收集静态文件 RUN python manage.py collectstatic --noinput diff --git a/backend/system/views/user.py b/backend/system/views/user.py index 280cd6e..5935a10 100644 --- a/backend/system/views/user.py +++ b/backend/system/views/user.py @@ -62,7 +62,8 @@ class UserLogin(ObtainAuthToken): client_ip = get_client_ip(request) # 获取IP地址的地理位置信息 - location_info = self.get_location_from_ip(client_ip) + # location_info = self.get_location_from_ip(client_ip) + location_info = '' # 更新登录IP和登录时间 user.login_ip = client_ip