feat(operation_log): 新增登录位置和处理时间字段

在操作日志中新增登录位置和处理时间字段,以提供更详细的日志信息。同时优化了IP地址归属地获取逻辑,并调整了日志展示界面的列宽。
This commit is contained in:
zhangtao
2025-05-18 18:51:41 +08:00
parent 6b782192fb
commit 93cbe5d987
16 changed files with 273 additions and 223 deletions
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from datetime import datetime
from sqlalchemy import Column, ForeignKey, String, Integer, Text, DateTime
from sqlalchemy import Column, ForeignKey, String, Integer, Text, DateTime, Float
from sqlalchemy.orm import relationship
from app.core.base_model import ModelBase
@@ -17,10 +17,12 @@ class OperationLogModel(ModelBase):
request_method = Column(String(10), nullable=True, comment="请求方式", index=True)
request_payload = Column(Text, nullable=True, comment="请求体")
request_ip = Column(String(50), nullable=True, comment="请求IP地址")
login_location=Column(String(255), nullable=True, comment="登录位置")
request_os = Column(String(64), nullable=True, comment="操作系统")
request_browser = Column(String(64), nullable=True, comment="浏览器")
response_code = Column(Integer, nullable=True, comment="响应状态码")
response_json = Column(Text, nullable=True, comment="响应体")
process_time = Column(Float, nullable=True, comment="处理时间")
# 审计字段
description = Column(Text, nullable=True, comment="备注说明")