```
feat(auth): 添加用户权限获取接口并完善JWT令牌角色信息 - 在JWT令牌中添加用户角色信息 - 新增get_my_permissions接口用于获取当前用户权限码列表 - 重构认证回调逻辑,增加错误日志记录 - 更新用户信息获取接口使用Authorization头验证 ```
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
"""add system_settings table
|
||||
|
||||
Revision ID: f6a7b8c9d0e1
|
||||
Revises: e5f6a7b8c9d0
|
||||
Create Date: 2026-04-05
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
revision = 'f6a7b8c9d0e1'
|
||||
down_revision = 'e5f6a7b8c9d0'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'system_settings',
|
||||
sa.Column('key', sa.String(100), primary_key=True),
|
||||
sa.Column('value', sa.Text(), nullable=False),
|
||||
sa.Column('description', sa.Text(), nullable=True),
|
||||
sa.Column('updated_at', sa.TIMESTAMP(), server_default=sa.text('now()')),
|
||||
)
|
||||
# 插入默认值
|
||||
op.execute("""
|
||||
INSERT INTO system_settings (key, value, description)
|
||||
VALUES ('check_interval_seconds', '1800', '定时检查间隔(秒),最小 300(5分钟)')
|
||||
""")
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('system_settings')
|
||||
Reference in New Issue
Block a user