Pine
|
cb1492f2d6
|
fix: 完整审查修复 - 5个问题
1. _resolve_identity: permissions_for 未归一化 role → 使用 account_type+permission_role
2. rbac_org.py: 用 user.role 判断 operator → 改用 capabilities
3. membership_service: sync_user_affiliation 不同步 organization_members → 新增 _sync_org_members
4. repositories.to_profile: capabilities 只查旧表 → 增加 organization_members 查询
5. Header.RoleBadge: account_type_label 被 t() 重复翻译 → 优先直接显示中文
|
2026-09-03 09:43:34 +08:00 |
|
Pine
|
d851b54755
|
refactor: 角色组织模型重构 - 阶段二完成
1. 运行迁移脚本:同步 2 条园区管理员 + 1 条企业管理员到 organization_members
2. 新增 get_user_organizations / get_user_primary_org 辅助函数
3. 改造各路由优先从 organization_members 查询组织:
- rbac_org.py: /org/me 返回所有绑定组织
- rbac_portals.py: referrals 和 carrier_park 优先用 organization_members
- rbac_hall.py: 发布岗位优先用 organization_members 获取企业
4. users.org_id 保留作回退,不删除字段,风险可控
|
2026-09-03 09:18:28 +08:00 |
|
Pine
|
6bb988cc3e
|
refactor: 角色组织账号模型重构 - 阶段一
1. capabilities 写入 JWT,避免每次请求查库
2. 移除 service 账号类型,非 operator/carrier 统一归为 opc_member
3. 前端统一基于 capabilities 判断权限
4. 清理登录接口死代码,恢复账号密码登录
5. 移除 enterprise/provider/government/investor/developer 角色
6. 清理 seed.py 中多余角色和权限定义
7. 重写 rbac_portals.py 只保留 carrier 路由
|
2026-09-03 00:35:40 +08:00 |
|
Pine
|
f6f2008498
|
refactor(auth): 账号类型彻底收敛为四种 + 各端口守卫改 service(去除冗余角色)
- 迁移守卫: provider/enterprise/government/investor/developer 一律 require_roles("service")
- token/profile.role 归一为四种(operator/carrier/opc_member/service); require_roles 与之一致
- 账号类型集中 app/domain/account_types.py; 子角色停用
|
2026-08-26 13:15:06 +08:00 |
|
Pine
|
01ef3c9637
|
refactor: schemas 抽取(DTO 从 models.py 与路由内联迁至 api/schemas/)
- 新建 api/schemas/:auth/agents/admin/ecosystem/investor/opc/operator/org/portals
- models.py 移除 15 个 Pydantic DTO(保留 ORM 数据模型层)
- 13 个路由内联 DTO 全部迁出,路由瘦身仅剩处理逻辑
- 全量 66 测试通过
|
2026-08-24 09:51:52 +08:00 |
|
Pine
|
c82f430986
|
feat: 业务层 services 继续抽取(路演/机构)
- RoadshowService:路演发布审核规则(operator 免审/政务范围免审/其余需审)
- OrgService:my_orgs 批量查消除 N+1、成员管理(admin 校验)
- 新增 Repository:Org.list_by_ids、OrgMember.list_for_user/get
- rbac_investor/rbac_org 接线,路由瘦身
|
2026-08-24 01:58:26 +08:00 |
|
Pine
|
980a2db6d9
|
refactor: 平台应用异步四层架构(接口/业务/领域/基础设施)
- 基础设施层 async:SQLAlchemy 异步引擎/会话、33 Repository async 化、models/security/seed 迁入 infrastructure、新增 cache.py(redis.asyncio) 与 oss.py(aioboto3)
- 接口层:routers 迁 api/routers 并全 async,dependencies 迁 api/dependencies(get_db/get_current_user async)
- 依赖:sqlalchemy[asyncio]/aiosqlite/asyncmy/redis/aioboto3;config 异步 URL + Redis/OSS 配置
- 删除废弃:旧同步 db/dependencies/repositories/storage
- 验证:平台 19 路由 + 培训 48 路由全注册;/health /auth/login /auth/me /admin/tasks /notifications 等接口 async 可用
|
2026-08-23 23:52:58 +08:00 |
|