feat: 组织架构重构 - 公司成员与部门成员模块,登录逻辑及权限改造

- 新增 org_company_member 表及模块(公司成员:owner/member 角色)
- 新增 org_department_member 表及模块(部门成员:一用户可属多部门)
- 移除 sys_user 的 companyId/departmentId/positionId 字段
- 重构 UserMenuServiceImpl 权限逻辑:super→全系统 / owner→公司菜单 / member→职位菜单
- 修复 RoleAspect 中 role='company' 应为 'admin' 的 BUG
- CurrentUserContext 注入 CompanyMemberService,新增 getCurrentMemberRole()
- 登录时公司选择逻辑:优先 lastCompanyId,需状态可用且未过期
- 超管(super)登录跳过公司校验
- 创建公司时自动创建拥有者账号并写入 org_company_member(role=owner)
- 联系人字段替换为拥有者姓名+拥有者电话
- org_company 表新增 owner_name/owner_phone 字段
- sys_user.phone 唯一约束修正
- 同步更新 SQL 设计文件(31张表 DDL)
This commit is contained in:
小蟑螂
2026-03-29 01:30:00 +08:00
parent 749779d452
commit 3b5e2abd43
47 changed files with 2531 additions and 561 deletions
@@ -20,11 +20,19 @@ const dynamicRoutes: RouteRecordRaw[] = mergeRouteModules(dynamicRouteFiles);
const staticRoutes: RouteRecordRaw[] = mergeRouteModules(staticRouteFiles);
const externalRoutes: RouteRecordRaw[] = [];
/**
* 将静态路由挂为 BasicLayout(Root)路由的子路由,
* 使其能共享布局(如侧边栏、头部),而不是独占整个页面。
*/
const rootRoute = coreRoutes.find((r) => r.name === 'Root');
if (rootRoute && !rootRoute.children?.length) {
rootRoute.children = staticRoutes;
}
/** 路由列表,由基本路由、外部路由和404兜底路由组成
* 无需走权限验证(会一直显示在菜单中) */
const routes: RouteRecordRaw[] = [
...coreRoutes,
...staticRoutes,
...externalRoutes,
fallbackNotFoundRoute,
];