fix: 统一系统生成时间为北京时间(UTC+8)并优化审计日志表格列展示

This commit is contained in:
DXC
2026-03-10 17:33:14 +08:00
parent de0a5c8db2
commit cd192624b9
8 changed files with 26 additions and 20 deletions

View File

@ -2,6 +2,7 @@ from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_cors import CORS
from flask_jwt_extended import JWTManager # 确保引入了 JWTManager
from datetime import datetime, timezone, timedelta
# 1. 创建扩展实例(此时未绑定具体的 App
db = SQLAlchemy()
@ -10,6 +11,11 @@ cors = CORS()
jwt = JWTManager() # 必须实例化
def beijing_time():
"""获取北京时间 (UTC+8)"""
return datetime.now(timezone(timedelta(hours=8)))
# 2. 定义初始化函数 (供工厂函数 create_app 调用)
def init_extensions(app):
"""