mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 01:19:19 +08:00
feat(auth): Token 负载增加 companyRole 字段
1. TokenPayload/AccessTokenPayload 增加 companyRole 字段 2. JwtUtils 生成和解析 Token 时包含 companyRole 3. UserServiceImpl 登录时从 org_company_member 获取 companyRole 写入 Token 4. CurrentUserContext 增加 getCurrentCompanyRole() 方法从 Token 获取 5. RoleAspect/PermissionAspect 改用 Token 中的 companyRole 直接判断权限
This commit is contained in:
@@ -82,6 +82,15 @@ public class CurrentUserContext {
|
||||
return getCurrentUserPayload().getRole();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户公司成员角色
|
||||
*
|
||||
* @return 公司成员角色 (owner/member)
|
||||
*/
|
||||
public String getCurrentCompanyRole() {
|
||||
return getCurrentUserPayload().getCompanyRole();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户岗位ID
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user