mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-10 20:57:14 +08:00
chore: continew-starter 2.1.0 => 2.1.1
1、IpUtils 获取 IPv4 归属地方法重命名 2、CurrentUserProvider => WebSocketClientService
This commit is contained in:
BIN
.idea/icon.png
generated
BIN
.idea/icon.png
generated
Binary file not shown.
Before Width: | Height: | Size: 21 KiB |
@@ -13,7 +13,7 @@
|
|||||||
<img src="https://sonarcloud.io/api/project_badges/measure?project=Charles7c_continew-admin&metric=alert_status" alt="Sonar Status" />
|
<img src="https://sonarcloud.io/api/project_badges/measure?project=Charles7c_continew-admin&metric=alert_status" alt="Sonar Status" />
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/continew-org/continew-starter" target="_blank">
|
<a href="https://github.com/continew-org/continew-starter" target="_blank">
|
||||||
<img src="https://img.shields.io/badge/ContiNew Starter-2.1.0-%236CB52D.svg" alt="ContiNew Starter" />
|
<img src="https://img.shields.io/badge/ContiNew Starter-2.1.1-%236CB52D.svg" alt="ContiNew Starter" />
|
||||||
</a>
|
</a>
|
||||||
<a href="https://spring.io/projects/spring-boot" target="_blank">
|
<a href="https://spring.io/projects/spring-boot" target="_blank">
|
||||||
<img src="https://img.shields.io/badge/Spring Boot-3.1.11-%236CB52D.svg?logo=Spring-Boot" alt="Spring Boot" />
|
<img src="https://img.shields.io/badge/Spring Boot-3.1.11-%236CB52D.svg?logo=Spring-Boot" alt="Spring Boot" />
|
||||||
@@ -207,7 +207,7 @@ public class DeptController extends BaseController<DeptService, DeptResp, DeptDe
|
|||||||
| <a href="https://arco.design/vue/docs/start" target="_blank">Arco Design</a> | 2.55.0 | 字节跳动推出的前端 UI 框架,年轻化的色彩和组件设计。 |
|
| <a href="https://arco.design/vue/docs/start" target="_blank">Arco Design</a> | 2.55.0 | 字节跳动推出的前端 UI 框架,年轻化的色彩和组件设计。 |
|
||||||
| <a href="https://www.typescriptlang.org/zh/" target="_blank">TypeScript</a> | 5.0.4 | TypeScript 是微软开发的一个开源的编程语言,通过在 JavaScript 的基础上添加静态类型定义构建而成。 |
|
| <a href="https://www.typescriptlang.org/zh/" target="_blank">TypeScript</a> | 5.0.4 | TypeScript 是微软开发的一个开源的编程语言,通过在 JavaScript 的基础上添加静态类型定义构建而成。 |
|
||||||
| <a href="https://cn.vitejs.dev/" target="_blank">Vite</a> | 5.1.5 | 下一代的前端工具链,为开发提供极速响应。 |
|
| <a href="https://cn.vitejs.dev/" target="_blank">Vite</a> | 5.1.5 | 下一代的前端工具链,为开发提供极速响应。 |
|
||||||
| [ContiNew Starter](https://github.com/continew-org/continew-starter) | 2.1.0 | ContiNew Starter 包含了一系列经过企业实践优化的依赖包(如 MyBatis-Plus、SaToken),可轻松集成到应用中,为开发人员减少手动引入依赖及配置的麻烦,为 Spring Boot Web 项目的灵活快速构建提供支持。 |
|
| [ContiNew Starter](https://github.com/continew-org/continew-starter) | 2.1.1 | ContiNew Starter 包含了一系列经过企业实践优化的依赖包(如 MyBatis-Plus、SaToken),可轻松集成到应用中,为开发人员减少手动引入依赖及配置的麻烦,为 Spring Boot Web 项目的灵活快速构建提供支持。 |
|
||||||
| <a href="https://spring.io/projects/spring-boot" target="_blank">Spring Boot</a> | 3.1.11 | 简化 Spring 应用的初始搭建和开发过程,基于“约定优于配置”的理念,使开发人员不再需要定义样板化的配置。(Spring Boot 3.0 开始,要求 Java 17 作为最低版本) |
|
| <a href="https://spring.io/projects/spring-boot" target="_blank">Spring Boot</a> | 3.1.11 | 简化 Spring 应用的初始搭建和开发过程,基于“约定优于配置”的理念,使开发人员不再需要定义样板化的配置。(Spring Boot 3.0 开始,要求 Java 17 作为最低版本) |
|
||||||
| <a href="https://undertow.io/" target="_blank">Undertow</a> | 2.3.10.Final | 采用 Java 开发的灵活的高性能 Web 服务器,提供包括阻塞和基于 NIO 的非堵塞机制。 |
|
| <a href="https://undertow.io/" target="_blank">Undertow</a> | 2.3.10.Final | 采用 Java 开发的灵活的高性能 Web 服务器,提供包括阻塞和基于 NIO 的非堵塞机制。 |
|
||||||
| <a href="https://sa-token.dev33.cn/" target="_blank">Sa-Token + JWT</a> | 1.38.0 | 轻量级 Java 权限认证框架,让鉴权变得简单、优雅。 |
|
| <a href="https://sa-token.dev33.cn/" target="_blank">Sa-Token + JWT</a> | 1.38.0 | 轻量级 Java 权限认证框架,让鉴权变得简单、优雅。 |
|
||||||
|
@@ -64,12 +64,6 @@
|
|||||||
<artifactId>continew-starter-auth-justauth</artifactId>
|
<artifactId>continew-starter-auth-justauth</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- ContiNew Starter 认证模块 - SaToken -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>top.continew</groupId>
|
|
||||||
<artifactId>continew-starter-auth-satoken</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- ContiNew Starter 数据访问模块 - MyBatis Plus -->
|
<!-- ContiNew Starter 数据访问模块 - MyBatis Plus -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>top.continew</groupId>
|
<groupId>top.continew</groupId>
|
||||||
@@ -86,6 +80,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>top.continew</groupId>
|
<groupId>top.continew</groupId>
|
||||||
<artifactId>continew-starter-messaging-websocket</artifactId>
|
<artifactId>continew-starter-messaging-websocket</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- ContiNew Starter 消息模块 - 邮件 -->
|
<!-- ContiNew Starter 消息模块 - 邮件 -->
|
||||||
|
@@ -21,8 +21,7 @@ import org.springframework.http.server.ServletServerHttpRequest;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import top.continew.admin.common.model.dto.LoginUser;
|
import top.continew.admin.common.model.dto.LoginUser;
|
||||||
import top.continew.admin.common.util.helper.LoginHelper;
|
import top.continew.admin.common.util.helper.LoginHelper;
|
||||||
import top.continew.starter.messaging.websocket.core.CurrentUserProvider;
|
import top.continew.starter.messaging.websocket.core.WebSocketClientService;
|
||||||
import top.continew.starter.messaging.websocket.model.CurrentUser;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前登录用户 Provider
|
* 当前登录用户 Provider
|
||||||
@@ -31,15 +30,13 @@ import top.continew.starter.messaging.websocket.model.CurrentUser;
|
|||||||
* @since 2024/6/4 22:13
|
* @since 2024/6/4 22:13
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class CurrentUserProviderImpl implements CurrentUserProvider {
|
public class WebSocketClientServiceImpl implements WebSocketClientService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CurrentUser getCurrentUser(ServletServerHttpRequest request) {
|
public String getClientId(ServletServerHttpRequest request) {
|
||||||
HttpServletRequest servletRequest = request.getServletRequest();
|
HttpServletRequest servletRequest = request.getServletRequest();
|
||||||
String token = servletRequest.getParameter("token");
|
String token = servletRequest.getParameter("token");
|
||||||
LoginUser loginUser = LoginHelper.getLoginUser(token);
|
LoginUser loginUser = LoginHelper.getLoginUser(token);
|
||||||
CurrentUser currentUser = new CurrentUser();
|
return loginUser.getToken();
|
||||||
currentUser.setUserId(loginUser.getToken());
|
|
||||||
return currentUser;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -55,7 +55,7 @@ public class LoginHelper {
|
|||||||
// 记录登录信息
|
// 记录登录信息
|
||||||
HttpServletRequest request = ServletUtils.getRequest();
|
HttpServletRequest request = ServletUtils.getRequest();
|
||||||
loginUser.setIp(JakartaServletUtil.getClientIP(request));
|
loginUser.setIp(JakartaServletUtil.getClientIP(request));
|
||||||
loginUser.setAddress(IpUtils.getAddress(loginUser.getIp()));
|
loginUser.setAddress(ExceptionUtils.exToNull(() -> IpUtils.getIpv4Address(loginUser.getIp())));
|
||||||
loginUser.setBrowser(ServletUtils.getBrowser(request));
|
loginUser.setBrowser(ServletUtils.getBrowser(request));
|
||||||
loginUser.setLoginTime(LocalDateTime.now());
|
loginUser.setLoginTime(LocalDateTime.now());
|
||||||
loginUser.setOs(StrUtil.subBefore(ServletUtils.getOs(request), " or", false));
|
loginUser.setOs(StrUtil.subBefore(ServletUtils.getOs(request), " or", false));
|
||||||
|
@@ -5,5 +5,5 @@
|
|||||||
\____|\___/ |_| |_| \__||_||_| \_| \___| \_/\_/ /_/ \_\\__,_||_| |_| |_||_||_| |_|
|
\____|\___/ |_| |_| \__||_||_| \_| \___| \_/\_/ /_/ \_\\__,_||_| |_| |_||_||_| |_|
|
||||||
|
|
||||||
:: ${project.name} :: v${project.version}
|
:: ${project.name} :: v${project.version}
|
||||||
:: ContiNew Starter :: v2.1.0
|
:: ContiNew Starter :: v2.1.1
|
||||||
:: Spring Boot :: v${spring-boot.version}
|
:: Spring Boot :: v${spring-boot.version}
|
||||||
|
2
pom.xml
2
pom.xml
@@ -13,7 +13,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>top.continew</groupId>
|
<groupId>top.continew</groupId>
|
||||||
<artifactId>continew-starter</artifactId>
|
<artifactId>continew-starter</artifactId>
|
||||||
<version>2.1.0</version>
|
<version>2.1.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>top.continew</groupId>
|
<groupId>top.continew</groupId>
|
||||||
|
Reference in New Issue
Block a user