【7.3.4】修复会话刷新的wsurl未设置的bug

pull/54/MERGE
fengshuonan 2023-03-29 11:50:25 +08:00
parent 8447e58ad5
commit fbb09a170c
1 changed files with 9 additions and 0 deletions

View File

@ -85,6 +85,8 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import static cn.stylefeng.roses.kernel.auth.api.exception.enums.AuthExceptionEnum.AUTH_EXPIRED_ERROR;
import static cn.stylefeng.roses.kernel.auth.api.exception.enums.AuthExceptionEnum.TOKEN_PARSE_ERROR;
@ -293,6 +295,13 @@ public class AuthServiceImpl implements AuthServiceApi {
LoginUser loginUser = userLoginInfo.getLoginUser();
loginUser.setTenantCode(tenantCode);
// 设置websocket url
String webSocketWsUrl = WebSocketConfigExpander.getWebSocketWsUrl();
Map<String, String> params = new HashMap<>(1);
params.put("token", token);
webSocketWsUrl = StrUtil.format(webSocketWsUrl, params);
loginUser.setWsUrl(webSocketWsUrl);
// 创建用户会话信息
sessionManagerApi.updateSession(token, loginUser);
} finally {