修改 模拟用户,租户ID获取方式
This commit is contained in:
parent
e8b3865643
commit
cf97bddeee
@ -118,8 +118,21 @@ public class TokenAuthenticationFilter extends OncePerRequestFilter {
|
|||||||
}
|
}
|
||||||
// 构建模拟用户
|
// 构建模拟用户
|
||||||
Long userId = Long.valueOf(token.substring(securityProperties.getMockSecret().length()));
|
Long userId = Long.valueOf(token.substring(securityProperties.getMockSecret().length()));
|
||||||
|
|
||||||
|
Long tenantId = null;
|
||||||
|
if (WebFrameworkUtils.getTenantId(request) == null) {
|
||||||
|
|
||||||
|
if (request.getParameter("tenantId") != null) {
|
||||||
|
|
||||||
|
tenantId = Long.valueOf(request.getParameter("tenantId"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
tenantId = WebFrameworkUtils.getTenantId(request);
|
||||||
|
}
|
||||||
|
|
||||||
return new LoginUser().setId(userId).setUserType(userType)
|
return new LoginUser().setId(userId).setUserType(userType)
|
||||||
.setTenantId(WebFrameworkUtils.getTenantId(request));
|
.setTenantId(tenantId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private LoginUser buildLoginUserByHeader(HttpServletRequest request) {
|
private LoginUser buildLoginUserByHeader(HttpServletRequest request) {
|
||||||
|
Loading…
Reference in New Issue
Block a user