mirror of https://gitee.com/stylefeng/roses
【7.0.4】【socket】更新wsUrl获取
parent
98a00adcf8
commit
8583f69a43
|
@ -25,6 +25,7 @@
|
||||||
package cn.stylefeng.roses.kernel.auth.api.pojo.login;
|
package cn.stylefeng.roses.kernel.auth.api.pojo.login;
|
||||||
|
|
||||||
import cn.hutool.core.lang.Dict;
|
import cn.hutool.core.lang.Dict;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.stylefeng.roses.kernel.auth.api.enums.DataScopeTypeEnum;
|
import cn.stylefeng.roses.kernel.auth.api.enums.DataScopeTypeEnum;
|
||||||
import cn.stylefeng.roses.kernel.auth.api.pojo.login.basic.SimpleRoleInfo;
|
import cn.stylefeng.roses.kernel.auth.api.pojo.login.basic.SimpleRoleInfo;
|
||||||
|
@ -36,7 +37,6 @@ import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录用户信息
|
* 登录用户信息
|
||||||
|
@ -144,7 +144,7 @@ public class LoginUser implements Serializable {
|
||||||
*/
|
*/
|
||||||
@ChineseDescription("用户的ws-url")
|
@ChineseDescription("用户的ws-url")
|
||||||
private String wsUrl;
|
private String wsUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 头像url
|
* 头像url
|
||||||
*/
|
*/
|
||||||
|
@ -168,14 +168,14 @@ public class LoginUser implements Serializable {
|
||||||
private String tenantCode;
|
private String tenantCode;
|
||||||
|
|
||||||
public String getWsUrl() {
|
public String getWsUrl() {
|
||||||
AtomicReference<String> returnUrl = new AtomicReference<>(StrUtil.EMPTY);
|
if (ObjectUtil.isEmpty(this.wsUrl)) {
|
||||||
Optional.ofNullable(this.wsUrl).ifPresent(url -> {
|
return "";
|
||||||
Map<String, Long> user = new HashMap<>(1);
|
}
|
||||||
user.put("userId", this.userId);
|
|
||||||
user.put("port", Long.valueOf(SocketConfigExpander.getSocketPort()));
|
Map<String, Long> params = new HashMap<>(1);
|
||||||
returnUrl.set(StrUtil.format(url, user));
|
params.put("userId", this.userId);
|
||||||
});
|
params.put("port", Long.valueOf(SocketConfigExpander.getSocketPort()));
|
||||||
return returnUrl.get();
|
return StrUtil.format(this.wsUrl, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue