【7.0.4】【socket】更新wsUrl获取

pull/22/head
fengshuonan 2021-06-12 09:33:12 +08:00
parent 98a00adcf8
commit 8583f69a43
1 changed files with 10 additions and 10 deletions

View File

@ -25,6 +25,7 @@
package cn.stylefeng.roses.kernel.auth.api.pojo.login;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.stylefeng.roses.kernel.auth.api.enums.DataScopeTypeEnum;
import cn.stylefeng.roses.kernel.auth.api.pojo.login.basic.SimpleRoleInfo;
@ -36,7 +37,6 @@ import lombok.Data;
import java.io.Serializable;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
/**
*
@ -168,14 +168,14 @@ public class LoginUser implements Serializable {
private String tenantCode;
public String getWsUrl() {
AtomicReference<String> returnUrl = new AtomicReference<>(StrUtil.EMPTY);
Optional.ofNullable(this.wsUrl).ifPresent(url -> {
Map<String, Long> user = new HashMap<>(1);
user.put("userId", this.userId);
user.put("port", Long.valueOf(SocketConfigExpander.getSocketPort()));
returnUrl.set(StrUtil.format(url, user));
});
return returnUrl.get();
if (ObjectUtil.isEmpty(this.wsUrl)) {
return "";
}
Map<String, Long> params = new HashMap<>(1);
params.put("userId", this.userId);
params.put("port", Long.valueOf(SocketConfigExpander.getSocketPort()));
return StrUtil.format(this.wsUrl, params);
}
}