From 880ef5eebca6653a2cb45bda83bb56899aa5b359 Mon Sep 17 00:00:00 2001 From: zhouwentao <1577701412@qq.com> Date: Mon, 27 May 2024 12:11:28 +0800 Subject: [PATCH] updates --- .../jeecg/common/constant/CommonConstant.java | 46 ++++++++++--------- .../mini/controller/MiniUserController.java | 8 ++-- .../modules/web/service/WebUserService.java | 2 +- 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java index 8e3299a..34798c2 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java @@ -30,7 +30,7 @@ public interface CommonConstant { * 系统日志类型: 登录 */ int LOG_TYPE_1 = 1; - + /** * 系统日志类型: 操作 */ @@ -40,40 +40,40 @@ public interface CommonConstant { * 操作日志类型: 查询 */ int OPERATE_TYPE_1 = 1; - + /** * 操作日志类型: 添加 */ int OPERATE_TYPE_2 = 2; - + /** * 操作日志类型: 更新 */ int OPERATE_TYPE_3 = 3; - + /** * 操作日志类型: 删除 */ int OPERATE_TYPE_4 = 4; - + /** * 操作日志类型: 倒入 */ int OPERATE_TYPE_5 = 5; - + /** * 操作日志类型: 导出 */ int OPERATE_TYPE_6 = 6; - - + + /** {@code 500 Server Error} (HTTP/1.0 - RFC 1945) */ Integer SC_INTERNAL_SERVER_ERROR_500 = 500; /** {@code 404 Not Found} (HTTP/1.0 - RFC 1945) */ Integer SC_INTERNAL_NOT_FOUND_404 = 404; /** {@code 200 OK} (HTTP/1.0 - RFC 1945) */ Integer SC_OK_200 = 200; - + /**访问权限认证未通过 510*/ Integer SC_JEECG_NO_AUTHZ=510; @@ -81,6 +81,8 @@ public interface CommonConstant { public static String PREFIX_USER_SHIRO_CACHE = "shiro:cache:org.jeecg.config.shiro.ShiroRealm.authorizationCache:"; /** 登录用户Token令牌缓存KEY前缀 */ String PREFIX_USER_TOKEN = "prefix_user_token:"; + //token有效期 x小时 + Integer PERFIX_USER_TOEKN_TIME = 3600 * 8; // /** Token缓存时间:3600秒即一小时 */ // int TOKEN_EXPIRE_TIME = 3600; @@ -96,7 +98,7 @@ public interface CommonConstant { */ Integer MENU_TYPE_0 = 0; /** - * 1:子菜单 + * 1:子菜单 */ Integer MENU_TYPE_1 = 1; /** @@ -107,34 +109,34 @@ public interface CommonConstant { /**通告对象类型(USER:指定用户,ALL:全体用户)*/ String MSG_TYPE_UESR = "USER"; String MSG_TYPE_ALL = "ALL"; - + /**发布状态(0未发布,1已发布,2已撤销)*/ String NO_SEND = "0"; String HAS_SEND = "1"; String HAS_CANCLE = "2"; - + /**阅读状态(0未读,1已读)*/ Integer HAS_READ_FLAG = 1; Integer NO_READ_FLAG = 0; - + /**优先级(L低,M中,H高)*/ String PRIORITY_L = "L"; String PRIORITY_M = "M"; String PRIORITY_H = "H"; - + /** * 短信模板方式 0 .登录模板、1.注册模板、2.忘记密码模板 */ String SMS_TPL_TYPE_0 = "0"; String SMS_TPL_TYPE_1 = "1"; String SMS_TPL_TYPE_2 = "2"; - + /** * 状态(0无效1有效) */ String STATUS_0 = "0"; String STATUS_1 = "1"; - + /** * 同步工作流引擎1同步0不同步 */ @@ -146,7 +148,7 @@ public interface CommonConstant { */ String MSG_CATEGORY_1 = "1"; String MSG_CATEGORY_2 = "2"; - + /** * 是否配置菜单的数据权限 1是0否 */ @@ -159,7 +161,7 @@ public interface CommonConstant { Integer USER_UNFREEZE = 1; Integer USER_FREEZE = 2; Integer USER_QUIT = 3; - + /**字典翻译文本后缀*/ String DICT_TEXT_SUFFIX = "_dictText"; /**字典翻译颜色后缀*/ @@ -390,7 +392,7 @@ public interface CommonConstant { * https:// https协议 */ String HTTPS_PROTOCOL = "https://"; - + /** 部门表唯一key,id */ String DEPART_KEY_ID = "id"; /** 部门表唯一key,orgCode */ @@ -490,7 +492,7 @@ public interface CommonConstant { * 用户租户状态(审核中) */ String USER_TENANT_UNDER_REVIEW = "3"; - + /** * 用户租户状态(拒绝) */ @@ -500,7 +502,7 @@ public interface CommonConstant { * 用户租户状态(邀请) */ String USER_TENANT_INVITE = "5"; - + /** * 不是叶子节点 */ @@ -576,5 +578,5 @@ public interface CommonConstant { */ public static final String SAAS_MODE_TENANT = "tenant"; //update-end---author:scott ---date::2023-09-10 for:积木报表常量---- - + } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/mini/controller/MiniUserController.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/mini/controller/MiniUserController.java index 8d86f58..357d32d 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/mini/controller/MiniUserController.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/mini/controller/MiniUserController.java @@ -115,7 +115,7 @@ public class MiniUserController { String token = JwtUtil.sign(sysUser.getUsername(), syspassword); // 设置token缓存有效时间 redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token); - redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, 3600 * 2); + redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, CommonConstant.PERFIX_USER_TOEKN_TIME); JSONObject obj = new JSONObject(); LoginUser loginUser = new LoginUser(); BeanUtils.copyProperties(sysUser, loginUser); @@ -164,7 +164,7 @@ public class MiniUserController { String token = JwtUtil.sign(sysUser.getUsername(), syspassword); // 设置token缓存有效时间 redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token); - redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, 3600 * 2); + redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, CommonConstant.PERFIX_USER_TOEKN_TIME); JSONObject obj = new JSONObject(); LoginUser loginUser = new LoginUser(); BeanUtils.copyProperties(sysUser, loginUser); @@ -234,7 +234,7 @@ public class MiniUserController { String token = JwtUtil.sign(username, syspassword); // 设置token缓存有效时间 redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token); - redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, 3600 * 2); + redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, CommonConstant.PERFIX_USER_TOEKN_TIME); JSONObject obj = new JSONObject(); LoginUser loginUser = new LoginUser(); BeanUtils.copyProperties(user, loginUser); @@ -330,7 +330,7 @@ public class MiniUserController { String token = JwtUtil.sign(username, syspassword); // 设置token缓存有效时间 redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token); - redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, 3600 * 2); + redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, CommonConstant.PERFIX_USER_TOEKN_TIME); JSONObject obj = new JSONObject(); LoginUser loginUser = new LoginUser(); BeanUtils.copyProperties(user, loginUser); diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/web/service/WebUserService.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/web/service/WebUserService.java index 10beef0..9524ba2 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/web/service/WebUserService.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/web/service/WebUserService.java @@ -58,7 +58,7 @@ public class WebUserService { String token = JwtUtil.sign(sysUser.getUsername(), syspassword); // 设置token缓存有效时间 redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token); - redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, 3600 * 2); + redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token,CommonConstant.PERFIX_USER_TOEKN_TIME); JSONObject obj = new JSONObject(); LoginUser loginUser = new LoginUser(); BeanUtils.copyProperties(sysUser, loginUser);