From 7a6db2d14e60a5fcc1a2786e6eaa3d46a0714e6c Mon Sep 17 00:00:00 2001 From: Bull-BCLS <1019113057@qq.com> Date: Wed, 6 Sep 2023 20:41:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E8=BF=98=E5=8E=9F=E7=99=BB=E5=BD=95?= =?UTF-8?q?=20Helper=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Revert #9 --- .../common/util/helper/LoginHelper.java | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/continew-admin-common/src/main/java/top/charles7c/cnadmin/common/util/helper/LoginHelper.java b/continew-admin-common/src/main/java/top/charles7c/cnadmin/common/util/helper/LoginHelper.java index 2feb1cec..a038d890 100644 --- a/continew-admin-common/src/main/java/top/charles7c/cnadmin/common/util/helper/LoginHelper.java +++ b/continew-admin-common/src/main/java/top/charles7c/cnadmin/common/util/helper/LoginHelper.java @@ -41,8 +41,8 @@ import top.charles7c.cnadmin.common.util.holder.LogContextHolder; /** * 登录助手 * - * @author Lion Li(RuoYi-Vue-Plus) * @author Charles7c + * @author Lion Li(RuoYi-Vue-Plus) * @since 2022/12/24 12:58 */ @NoArgsConstructor(access = AccessLevel.PRIVATE) @@ -55,10 +55,6 @@ public class LoginHelper { * 登录用户信息 */ public static void login(LoginUser loginUser) { - if (null == loginUser) { - return; - } - // 记录登录信息 HttpServletRequest request = ServletUtils.getRequest(); loginUser.setClientIp(ServletUtil.getClientIP(request)); @@ -66,12 +62,11 @@ public class LoginHelper { loginUser.setBrowser(ServletUtils.getBrowser(request)); LogContext logContext = LogContextHolder.get(); loginUser.setLoginTime(null != logContext ? logContext.getCreateTime() : LocalDateTime.now()); - - // 登录保存用户信息 + // 登录并缓存用户信息 StpUtil.login(loginUser.getId()); SaHolder.getStorage().set(CacheConsts.LOGIN_USER_KEY, loginUser); loginUser.setToken(StpUtil.getTokenValue()); - StpUtil.getSession().set(CacheConsts.LOGIN_USER_KEY, loginUser); + StpUtil.getTokenSession().set(CacheConsts.LOGIN_USER_KEY, loginUser); } /** @@ -84,11 +79,11 @@ public class LoginHelper { if (null != loginUser) { return loginUser; } - SaSession session = StpUtil.getSession(); - if (null == session) { + SaSession tokenSession = StpUtil.getTokenSession(); + if (null == tokenSession) { return null; } - loginUser = (LoginUser)session.get(CacheConsts.LOGIN_USER_KEY); + loginUser = (LoginUser)tokenSession.get(CacheConsts.LOGIN_USER_KEY); SaHolder.getStorage().set(CacheConsts.LOGIN_USER_KEY, loginUser); return loginUser; } @@ -101,12 +96,11 @@ public class LoginHelper { * @return 登录用户信息 */ public static LoginUser getLoginUser(String token) { - Object loginId = StpUtil.getLoginIdByToken(token); - SaSession session = StpUtil.getSessionByLoginId(loginId); - if (null == session) { + SaSession tokenSession = StpUtil.getTokenSessionByToken(token); + if (null == tokenSession) { return null; } - return (LoginUser)session.get(CacheConsts.LOGIN_USER_KEY); + return (LoginUser)tokenSession.get(CacheConsts.LOGIN_USER_KEY); } /** From 8b024b3ee3ceb6dabd2d097d00ba852580b9e9f0 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Wed, 6 Sep 2023 20:56:05 +0800 Subject: [PATCH 2/2] release: v1.1.1 --- CHANGELOG.md | 14 ++++++++++++++ README.md | 2 +- continew-admin-ui/package.json | 2 +- continew-admin-ui/src/components/footer/index.vue | 2 +- .../src/main/resources/application.yml | 2 +- pom.xml | 2 +- 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32ddb8ff..cb786c6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## [v1.1.1](https://github.com/Charles7c/continew-admin/compare/v1.1.0...v1.1.1) (2023-09-06) + +### 💎 功能优化 + +- 调整 Mock 响应时长,以解决前端偶发需重复登录问题 ([df19c5d](https://github.com/Charles7c/continew-admin/commit/df19c5d2197fabb61cbdd4dccf1c427fb23d77d4)) + +### 🐛 问题修复 + +- 还原登录 Helper 优化(导致重大登录问题及查询在线用户错误) ([#15](https://github.com/Charles7c/continew-admin/pull/15)) ([7a6db2d](https://github.com/Charles7c/continew-admin/commit/7a6db2d14e60a5fcc1a2786e6eaa3d46a0714e6c)) ([#9](https://github.com/Charles7c/continew-admin/pull/9)) ([9e2a5ef](https://github.com/Charles7c/continew-admin/commit/9e2a5ef1249fd93dd10f2c255bf77c3eaa64a241)) +- 修复刷新页面后,选中菜单无法保持展开状态的问题 ([3fc7adb](https://github.com/Charles7c/continew-admin/commit/3fc7adb1e2bd4b648753bd2999df725417e01680)) +- 修复侧边栏菜单无法显示自定义图标的问题 ([10ca5d8](https://github.com/Charles7c/continew-admin/commit/10ca5d8c76aa39a207ea7db4442bf63ff4578273)) +- 更正 README 文档项目结构部分内容 ([486da2f](https://github.com/Charles7c/continew-admin/commit/486da2f79bfc5379213bf666b8f325fb8096ebc6)) +- 修复公告缺失待发布状态的问题 ([#14](https://github.com/Charles7c/continew-admin/pull/14)) ([46cc4c9](https://github.com/Charles7c/continew-admin/commit/46cc4c9307e3cc7060ae436f59f007831104884a)) + ## [v1.1.0](https://github.com/Charles7c/continew-admin/compare/v1.0.1...v1.1.0) (2023-09-01) ### ✨ 新特性 diff --git a/README.md b/README.md index 434d57e6..06693fc9 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ License -Release +Release GitHub stars diff --git a/continew-admin-ui/package.json b/continew-admin-ui/package.json index bc3045a3..a557b6ec 100644 --- a/continew-admin-ui/package.json +++ b/continew-admin-ui/package.json @@ -1,7 +1,7 @@ { "name": "continew-admin-ui", "description": "ContiNew Admin 中后台管理框架,Continue New Admin,持续以最新流行技术栈构建,拥抱变化,迭代优化。", - "version": "1.1.0", + "version": "1.1.1", "private": true, "author": "Charles7c", "license": "Apache-2.0", diff --git a/continew-admin-ui/src/components/footer/index.vue b/continew-admin-ui/src/components/footer/index.vue index c569ba4a..30d0d1e0 100644 --- a/continew-admin-ui/src/components/footer/index.vue +++ b/continew-admin-ui/src/components/footer/index.vue @@ -14,7 +14,7 @@ target="_blank" rel="noopener" >{{ $t('title') }}  v1.1.0 + >  v1.1.1  ⋅  津ICP备2022005864号-2 diff --git a/continew-admin-webapi/src/main/resources/application.yml b/continew-admin-webapi/src/main/resources/application.yml index f8d9715c..175b4867 100644 --- a/continew-admin-webapi/src/main/resources/application.yml +++ b/continew-admin-webapi/src/main/resources/application.yml @@ -5,7 +5,7 @@ project: # 应用名称 appName: continew-admin # 版本 - version: 1.1.0 + version: 1.1.1 # 描述 description: ContiNew Admin 中后台管理框架/脚手架,Continue New Admin,持续以最新流行技术栈构建,拥抱变化,迭代优化。 # URL diff --git a/pom.xml b/pom.xml index 0bd6481f..05b9a1f6 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ limitations under the License. 5.8.16 - 1.1.0 + 1.1.1 1.8 2.28.0 8