f1f8518985
feat(auth): 添加用户权限获取接口并完善JWT令牌角色信息 - 在JWT令牌中添加用户角色信息 - 新增get_my_permissions接口用于获取当前用户权限码列表 - 重构认证回调逻辑,增加错误日志记录 - 更新用户信息获取接口使用Authorization头验证 ```
27 lines
668 B
Python
27 lines
668 B
Python
"""add region to olt_devices
|
|
|
|
Revision ID: d4e5f6a7b8c9
|
|
Revises: c3d4e5f6a7b8
|
|
Create Date: 2026-04-05
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
revision = 'd4e5f6a7b8c9'
|
|
down_revision = 'c3d4e5f6a7b8'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
op.add_column('olt_devices', sa.Column('region', sa.String(100), nullable=True))
|
|
op.create_index('ix_olt_devices_region', 'olt_devices', ['region'])
|
|
# 默认将现有 OLT 设置为城区
|
|
op.execute("UPDATE olt_devices SET region = '城区' WHERE region IS NULL")
|
|
|
|
|
|
def downgrade():
|
|
op.drop_index('ix_olt_devices_region', 'olt_devices')
|
|
op.drop_column('olt_devices', 'region')
|