mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-08 20:49:00 +08:00
前端第一次登录时或者部分请求时可能tenant_id会是undefined
http://192.168.195.219:5005/ws/info?access_token=54aaf82e-89ef-488b-a692-f542532f010b&TENANT-ID=undefined 在开启webSocket的时候会有一些请求没有租户的id,前端请求过来会是undefined,还有/actuator/health这个请求的租户id也是undefined,会造成第一次登录的时候,没有直接把当前的sessions添加到WebSocketSessionHolder的USER_SESSION_MAP里面
This commit is contained in:
1 parent
0a0cbdcb3a
commit
af2ddcdb83
1 file changed
+2
-2
+2
-2
@@ -52,10 +52,10 @@ public class TenantContextHolderFilter extends GenericFilterBean {
|
||||
|
||||
log.debug("获取header中的租户ID为:{}", headerTenantId);
|
||||
|
||||
if (StrUtil.isNotBlank(headerTenantId)) {
|
||||
if (StrUtil.isNotBlank(headerTenantId) && !headerTenantId.equals("undefined")) {
|
||||
TenantContextHolder.setTenantId(Long.parseLong(headerTenantId));
|
||||
}
|
||||
else if (StrUtil.isNotBlank(paramTenantId)) {
|
||||
else if (StrUtil.isNotBlank(paramTenantId) && !paramTenantId.equals("undefined") {
|
||||
TenantContextHolder.setTenantId(Long.parseLong(paramTenantId));
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in new issue
Block a user