diff --git a/backend/app/api/v1/models/system/operation_log_model.py b/backend/app/api/v1/models/system/operation_log_model.py index 26b2902a..006d08c4 100644 --- a/backend/app/api/v1/models/system/operation_log_model.py +++ b/backend/app/api/v1/models/system/operation_log_model.py @@ -23,7 +23,7 @@ class OperationLogModel(ModelBase): 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="处理时间") + process_time = Column(String(20), nullable=True, comment="处理时间") # 审计字段 description = Column(Text, nullable=True, comment="备注说明") diff --git a/backend/app/api/v1/schemas/system/operation_log_schema.py b/backend/app/api/v1/schemas/system/operation_log_schema.py index 1044278b..d6728aff 100644 --- a/backend/app/api/v1/schemas/system/operation_log_schema.py +++ b/backend/app/api/v1/schemas/system/operation_log_schema.py @@ -18,7 +18,7 @@ class OperationLogCreateSchema(BaseModel): request_browser: Optional[str] = Field(default=None, description="请求浏览器") response_code: Optional[int] = Field(default=None, description="响应状态码") response_json: Optional[str] = Field(default=None, description="响应 JSON 数据") - process_time: Optional[float] = Field(default=None, description="处理时间") + process_time: Optional[str] = Field(default=None, description="处理时间") description: Optional[str] = Field(default=None, max_length=255, description="备注") creator_id: Optional[int] = Field(default=None, description="创建人ID") diff --git a/backend/app/api/v1/services/system/user_service.py b/backend/app/api/v1/services/system/user_service.py index 67ace72d..cd93668a 100644 --- a/backend/app/api/v1/services/system/user_service.py +++ b/backend/app/api/v1/services/system/user_service.py @@ -414,13 +414,16 @@ class UserService: # 定义字段映射 mapping_dict = { 'id': '用户编号', + 'avatar': '头像', 'username': '用户名称', 'name': '用户昵称', 'dept_name': '部门', - 'email': '邮箱地址', - 'mobile': '手机号码', + 'email': '邮箱', + 'mobile': '手机号', 'gender': '性别', 'status': '状态', + 'is_superuser': '是否超级管理员', + 'last_login': '最后登录时间', 'description': '备注', 'created_at': '创建时间', 'updated_at': '更新时间', @@ -431,7 +434,7 @@ class UserService: # 复制数据并转换 data = user_list.copy() for item in data: - item['status'] = '正常' if item.get('status') else '停用' + item['status'] = '启用' if item.get('status') else '停用' gender = item.get('gender') item['gender'] = '男' if gender == 1 else ('女' if gender == 2 else '未知') diff --git a/backend/app/core/router_class.py b/backend/app/core/router_class.py index 37159b3e..8f1b5a17 100644 --- a/backend/app/core/router_class.py +++ b/backend/app/core/router_class.py @@ -57,7 +57,7 @@ class OperationLogRoute(APIRoute): payload = str(oper_param) response_data = response.body if "application/json" in response.headers.get("Content-Type", "") else b"{}" - process_time = time.time() - start_time + process_time = f"{(time.time() - start_time):.4f}s" # 获取当前用户ID,如果是登录接口则为空 log_type = 1 # 1:登录日志 2:操作日志 diff --git a/backend/env/.env.dev b/backend/env/.env.dev index 7cfac2ab..4c4b3218 100644 --- a/backend/env/.env.dev +++ b/backend/env/.env.dev @@ -29,7 +29,7 @@ ROOT_PATH = "/api/v1" # API路由前缀 DEMO_ENABLE = False # 是否启用演示模式 # 数据库配置 -DB_DRIVER = "mysql" # sqlite、mysql +DB_DRIVER = "sqlite" # sqlite、mysql # SQLite配置 SQLITE_DB_NAME = "dev_sql.db" diff --git a/frontend/.editorconfig b/frontend/.editorconfig deleted file mode 100644 index 00ee2de4..00000000 --- a/frontend/.editorconfig +++ /dev/null @@ -1,15 +0,0 @@ -# http://editorconfig.org -root = true - -# 表示所有文件适用 -[*] -charset = utf-8 # 设置文件字符集为 utf-8 -end_of_line = lf # 控制换行类型(lf | cr | crlf) -indent_style = space # 缩进风格(tab | space) -indent_size = 2 # 缩进大小 -insert_final_newline = true # 始终在文件末尾插入一个新行 - -# 表示仅 md 文件适用以下规则 -[*.md] -max_line_length = off # 关闭最大行长度限制 -trim_trailing_whitespace = false # 关闭末尾空格修剪 diff --git a/frontend/src/api/system/log.ts b/frontend/src/api/system/log.ts index 5da00e5a..bdaf1d7a 100644 --- a/frontend/src/api/system/log.ts +++ b/frontend/src/api/system/log.ts @@ -58,7 +58,7 @@ export interface LogTable { response_code?: number; request_payload?: string; response_json?: string; - process_time?: number; + process_time?: string; description?: string; created_at?: string; updated_at?: string; diff --git a/frontend/src/components/IntervalTab/index.vue b/frontend/src/components/IntervalTab/index.vue index abf6fa32..c078d1a9 100644 --- a/frontend/src/components/IntervalTab/index.vue +++ b/frontend/src/components/IntervalTab/index.vue @@ -1,43 +1,31 @@ - - - - - - {{ second }} - - - - - - - {{min}} - - - - - - - {{hour}} - - - - - - - {{day}} - - - - - - - {{week}} - - - - - + + + + {{ second }} + + + + + {{min}} + + + + + {{hour}} + + + + + {{day}} + + + + + {{week}} + + +