From 654944b5c7f3312aefded4be30fbf1b50709a8dc Mon Sep 17 00:00:00 2001 From: flyer <1337456911@qq.com> Date: Mon, 30 Jan 2023 09:41:16 +0800 Subject: [PATCH 01/34] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dvue3=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=EF=BC=8C=E7=82=B9=E5=87=BB=E5=88=A0=E9=99=A4=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=90=8E=E5=BC=B9=E6=A1=86=E6=98=BE=E7=A4=BA[object=20Object]?= =?UTF-8?q?=E6=88=96=E6=8E=A7=E5=88=B6=E5=8F=B0=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm index a93922ef5..0b15445b4 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm @@ -540,7 +540,7 @@ function submitForm() { /** 删除按钮操作 */ function handleDelete(row) { const _${pkColumn.javaField}s = row.${pkColumn.javaField} || ids.value; - proxy.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + ${pkColumn.javaField}s + '"的数据项?').then(function() { + proxy.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + _${pkColumn.javaField}s + '"的数据项?').then(function() { loading.value = true; return del${BusinessName}(_${pkColumn.javaField}s); }).then(() => { From 7c05920e73d57c57d304bdf5b4ca6957dd3f80c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Mon, 30 Jan 2023 18:22:25 +0800 Subject: [PATCH 02/34] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E6=A1=86?= =?UTF-8?q?=E6=9E=B6=E4=BB=A3=E7=A0=81=E4=B9=A6=E5=86=99=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/SysRoleController.java | 2 +- .../com/ruoyi/common/helper/LoginHelper.java | 5 ++--- .../system/service/SysPermissionService.java | 7 ++++--- .../service/impl/SysConfigServiceImpl.java | 4 ++-- .../system/service/impl/SysDeptServiceImpl.java | 2 +- .../system/service/impl/SysMenuServiceImpl.java | 10 +++++----- .../system/service/impl/SysRoleServiceImpl.java | 10 +++++----- .../system/service/impl/SysUserServiceImpl.java | 17 ++++++----------- .../resources/mapper/system/SysUserMapper.xml | 12 ++++++------ 9 files changed, 32 insertions(+), 37 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java index 5768806c2..00a8a008b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java @@ -112,7 +112,7 @@ public class SysRoleController extends BaseController { // 更新缓存用户权限 LoginUser loginUser = getLoginUser(); SysUser sysUser = userService.selectUserById(loginUser.getUserId()); - if (ObjectUtil.isNotNull(sysUser) && !sysUser.isAdmin()) { + if (ObjectUtil.isNotNull(sysUser) && !LoginHelper.isAdmin()) { loginUser.setMenuPermission(permissionService.getMenuPermission(sysUser)); LoginHelper.setLoginUser(loginUser); } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java b/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java index 05e370b5d..cee0e93ae 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java @@ -2,7 +2,6 @@ package com.ruoyi.common.helper; import cn.dev33.satoken.context.SaHolder; import cn.dev33.satoken.stp.StpUtil; -import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ObjectUtil; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.model.LoginUser; @@ -15,11 +14,11 @@ import lombok.NoArgsConstructor; /** * 登录鉴权助手 - * + *

* user_type 为 用户类型 同一个用户表 可以有多种用户类型 例如 pc,app * deivce 为 设备类型 同一个用户类型 可以有 多种设备类型 例如 web,ios * 可以组成 用户类型与设备类型多对多的 权限灵活控制 - * + *

* 多用户体系 针对 多种用户类型 但权限控制不一致 * 可以组成 多用户类型表与多设备类型 分别控制权限 * diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/SysPermissionService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/SysPermissionService.java index 97ff4801a..79d6e2522 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/SysPermissionService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/SysPermissionService.java @@ -1,5 +1,6 @@ package com.ruoyi.system.service; +import cn.hutool.core.collection.CollUtil; import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysUser; import lombok.RequiredArgsConstructor; @@ -28,7 +29,7 @@ public class SysPermissionService { * @return 角色权限信息 */ public Set getRolePermission(SysUser user) { - Set roles = new HashSet(); + Set roles = new HashSet<>(); // 管理员拥有所有权限 if (user.isAdmin()) { roles.add("admin"); @@ -45,13 +46,13 @@ public class SysPermissionService { * @return 菜单权限信息 */ public Set getMenuPermission(SysUser user) { - Set perms = new HashSet(); + Set perms = new HashSet<>(); // 管理员拥有所有权限 if (user.isAdmin()) { perms.add("*:*:*"); } else { List roles = user.getRoles(); - if (!roles.isEmpty() && roles.size() > 1) { + if (CollUtil.isNotEmpty(roles)) { // 多角色设置permissions属性,以便数据权限匹配权限 for (SysRole role : roles) { Set rolePerms = menuService.selectMenuPermsByRoleId(role.getRoleId()); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java index c39ec74df..c77612e72 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java @@ -205,9 +205,9 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService { */ @Override public String checkConfigKeyUnique(SysConfig config) { - Long configId = ObjectUtil.isNull(config.getConfigId()) ? -1L : config.getConfigId(); + long configId = ObjectUtil.isNull(config.getConfigId()) ? -1L : config.getConfigId(); SysConfig info = baseMapper.selectOne(new LambdaQueryWrapper().eq(SysConfig::getConfigKey, config.getConfigKey())); - if (ObjectUtil.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) { + if (ObjectUtil.isNotNull(info) && info.getConfigId() != configId) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index 00b402467..afb7a3155 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -259,7 +259,7 @@ public class SysDeptServiceImpl implements ISysDeptService { dept.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors)); list.add(dept); } - if (list.size() > 0) { + if (CollUtil.isNotEmpty(list)) { baseMapper.updateBatchById(list); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java index 4d3406757..4056d5670 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java @@ -153,7 +153,7 @@ public class SysMenuServiceImpl implements ISysMenuService { */ @Override public List buildMenus(List menus) { - List routers = new LinkedList(); + List routers = new LinkedList<>(); for (SysMenu menu : menus) { RouterVo router = new RouterVo(); router.setHidden("1".equals(menu.getVisible())); @@ -169,7 +169,7 @@ public class SysMenuServiceImpl implements ISysMenuService { router.setChildren(buildMenus(cMenus)); } else if (isMenuFrame(menu)) { router.setMeta(null); - List childrenList = new ArrayList(); + List childrenList = new ArrayList<>(); RouterVo children = new RouterVo(); children.setPath(menu.getPath()); children.setComponent(menu.getComponent()); @@ -181,7 +181,7 @@ public class SysMenuServiceImpl implements ISysMenuService { } else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) { router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon())); router.setPath("/"); - List childrenList = new ArrayList(); + List childrenList = new ArrayList<>(); RouterVo children = new RouterVo(); String routerPath = innerLinkReplaceEach(menu.getPath()); children.setPath(routerPath); @@ -394,7 +394,7 @@ public class SysMenuServiceImpl implements ISysMenuService { * @return String */ public List getChildPerms(List list, int parentId) { - List returnList = new ArrayList(); + List returnList = new ArrayList<>(); for (SysMenu t : list) { // 一、根据传入的某个父节点ID,遍历该父节点的所有子节点 if (t.getParentId() == parentId) { @@ -433,7 +433,7 @@ public class SysMenuServiceImpl implements ISysMenuService { * 判断是否有子节点 */ private boolean hasChild(List list, SysMenu t) { - return getChildList(list, t).size() > 0; + return CollUtil.isNotEmpty(getChildList(list, t)); } /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java index e7e5b53c5..9e85bee57 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java @@ -14,6 +14,7 @@ import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.helper.LoginHelper; +import com.ruoyi.common.utils.StreamUtils; import com.ruoyi.system.domain.SysRoleDept; import com.ruoyi.system.domain.SysRoleMenu; import com.ruoyi.system.domain.SysUserRole; @@ -397,14 +398,13 @@ public class SysRoleServiceImpl implements ISysRoleService { public int insertAuthUsers(Long roleId, Long[] userIds) { // 新增用户与角色管理 int rows = 1; - List list = new ArrayList(); - for (Long userId : userIds) { + List list = StreamUtils.toList(Arrays.asList(userIds), userId -> { SysUserRole ur = new SysUserRole(); ur.setUserId(userId); ur.setRoleId(roleId); - list.add(ur); - } - if (list.size() > 0) { + return ur; + }); + if (CollUtil.isNotEmpty(list)) { rows = userRoleMapper.insertBatch(list) ? list.size() : 0; } return rows; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java index 4e63f17ea..862d029d3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -30,7 +30,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -211,7 +210,6 @@ public class SysUserServiceImpl implements ISysUserService { * 校验手机号码是否唯一 * * @param user 用户信息 - * @return */ @Override public String checkPhoneUnique(SysUser user) { @@ -228,7 +226,6 @@ public class SysUserServiceImpl implements ISysUserService { * 校验email是否唯一 * * @param user 用户信息 - * @return */ @Override public String checkEmailUnique(SysUser user) { @@ -417,13 +414,12 @@ public class SysUserServiceImpl implements ISysUserService { Long[] posts = user.getPostIds(); if (ArrayUtil.isNotEmpty(posts)) { // 新增用户与岗位管理 - List list = new ArrayList<>(posts.length); - for (Long postId : posts) { + List list = StreamUtils.toList(Arrays.asList(posts), postId -> { SysUserPost up = new SysUserPost(); up.setUserId(user.getUserId()); up.setPostId(postId); - list.add(up); - } + return up; + }); userPostMapper.insertBatch(list); } } @@ -437,13 +433,12 @@ public class SysUserServiceImpl implements ISysUserService { public void insertUserRole(Long userId, Long[] roleIds) { if (ArrayUtil.isNotEmpty(roleIds)) { // 新增用户与角色管理 - List list = new ArrayList<>(roleIds.length); - for (Long roleId : roleIds) { + List list = StreamUtils.toList(Arrays.asList(roleIds), roleId -> { SysUserRole ur = new SysUserRole(); ur.setUserId(userId); ur.setRoleId(roleId); - list.add(ur); - } + return ur; + }); userRoleMapper.insertBatch(list); } } diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index dacdcd8a6..06a653efe 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -86,17 +86,17 @@ From f8ac8c085e22bc1dfe1dfaf0436e7ff4d048c504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Wed, 1 Feb 2023 17:34:58 +0800 Subject: [PATCH 03/34] =?UTF-8?q?update=20=E8=B0=83=E6=95=B4=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E8=BF=9E=E6=8E=A5=E6=B1=A0=E9=BB=98=E8=AE=A4=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-admin/src/main/resources/application-dev.yml | 4 ++-- ruoyi-admin/src/main/resources/application-prod.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ruoyi-admin/src/main/resources/application-dev.yml b/ruoyi-admin/src/main/resources/application-dev.yml index 7b7380b8a..1db59bbc7 100644 --- a/ruoyi-admin/src/main/resources/application-dev.yml +++ b/ruoyi-admin/src/main/resources/application-dev.yml @@ -86,11 +86,11 @@ spring: # 最小空闲线程数量 minIdle: 10 # 配置获取连接等待超时的时间 - connectionTimeout: 10000 + connectionTimeout: 30000 # 校验超时时间 validationTimeout: 5000 # 空闲连接存活最大时间,默认10分钟 - idleTimeout: 60000 + idleTimeout: 600000 # 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟 maxLifetime: 900000 # 连接测试query(配置检测连接是否有效) diff --git a/ruoyi-admin/src/main/resources/application-prod.yml b/ruoyi-admin/src/main/resources/application-prod.yml index 970fe4c5a..0852d4199 100644 --- a/ruoyi-admin/src/main/resources/application-prod.yml +++ b/ruoyi-admin/src/main/resources/application-prod.yml @@ -89,11 +89,11 @@ spring: # 最小空闲线程数量 minIdle: 10 # 配置获取连接等待超时的时间 - connectionTimeout: 10000 + connectionTimeout: 30000 # 校验超时时间 validationTimeout: 5000 # 空闲连接存活最大时间,默认10分钟 - idleTimeout: 60000 + idleTimeout: 600000 # 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟 maxLifetime: 900000 # 连接测试query(配置检测连接是否有效) From 6c6d92a776cd011ff63b1507946eadf939514ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Fri, 3 Feb 2023 00:40:49 +0800 Subject: [PATCH 04/34] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E9=97=AE=E9=A2=98=E5=BC=80=E5=85=B3=E4=B8=8D=E7=94=9F?= =?UTF-8?q?=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-admin/src/main/resources/application.yml | 5 +++-- .../main/java/com/ruoyi/framework/config/SwaggerConfig.java | 2 +- .../ruoyi/framework/config/properties/SwaggerProperties.java | 5 ----- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 4f3da2c5f..1534251f8 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -196,8 +196,6 @@ mybatis-encryptor: # Swagger配置 swagger: - # 是否开启swagger - enabled: true info: # 标题 title: '标题:${ruoyi.name}后台管理系统_接口文档' @@ -219,6 +217,9 @@ swagger: name: ${sa-token.token-name} springdoc: + api-docs: + # 是否开启接口文档 + enabled: true swagger-ui: # 持久化认证数据 persistAuthorization: true diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java index ab92cf591..88af7e725 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java @@ -33,7 +33,7 @@ import java.util.Set; @RequiredArgsConstructor @Configuration @AutoConfigureBefore(SpringDocConfiguration.class) -@ConditionalOnProperty(name = "swagger.enabled", havingValue = "true", matchIfMissing = true) +@ConditionalOnProperty(name = "springdoc.api-docs.enabled", havingValue = "true", matchIfMissing = true) public class SwaggerConfig { private final SwaggerProperties swaggerProperties; diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/SwaggerProperties.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/SwaggerProperties.java index 736d70a45..ac6fc4249 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/SwaggerProperties.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/SwaggerProperties.java @@ -23,11 +23,6 @@ import java.util.List; @ConfigurationProperties(prefix = "swagger") public class SwaggerProperties { - /** - * 是否开启 openApi 文档 - */ - private Boolean enabled = true; - /** * 文档基本信息 */ From 61db8435762629be7ac126d35ab7e28ed449e2fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Sun, 5 Feb 2023 12:43:14 +0800 Subject: [PATCH 05/34] =?UTF-8?q?update=20DictDataMapper=20=E6=B3=A8?= =?UTF-8?q?=E8=A7=A3=E6=A0=87=E6=B3=A8=E8=BF=87=E6=9C=9F=20=E6=8E=A8?= =?UTF-8?q?=E8=8D=90=E4=BD=BF=E7=94=A8=20Translation=20=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/common/annotation/DictDataMapper.java | 2 ++ .../java/com/ruoyi/common/jackson/DictDataJsonSerializer.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DictDataMapper.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DictDataMapper.java index 5c14a5520..564b2a4a1 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DictDataMapper.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DictDataMapper.java @@ -13,7 +13,9 @@ import java.lang.annotation.Target; * 字典数据映射注解 * * @author itino + * @deprecated 建议使用通用翻译注解 */ +@Deprecated @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.METHOD}) @JacksonAnnotationsInside diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/jackson/DictDataJsonSerializer.java b/ruoyi-common/src/main/java/com/ruoyi/common/jackson/DictDataJsonSerializer.java index caa059b92..5fbf0519c 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/jackson/DictDataJsonSerializer.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/jackson/DictDataJsonSerializer.java @@ -22,7 +22,9 @@ import java.util.Objects; * 字典数据json序列化工具 * * @author itino + * @deprecated 建议使用通用翻译注解 */ +@Deprecated @Slf4j public class DictDataJsonSerializer extends JsonSerializer implements ContextualSerializer { From bc06550918780953baa650accb8380a4bfb7dd7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Sun, 5 Feb 2023 12:45:55 +0800 Subject: [PATCH 06/34] =?UTF-8?q?add=20=E6=96=B0=E5=A2=9E=20=E9=80=9A?= =?UTF-8?q?=E7=94=A8=E7=BF=BB=E8=AF=91=E6=B3=A8=E8=A7=A3=E5=8F=8A=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0(=E9=83=A8=E9=97=A8=E5=90=8D=E3=80=81=E5=AD=97?= =?UTF-8?q?=E5=85=B8=E3=80=81oss=E3=80=81=E7=94=A8=E6=88=B7=E5=90=8D)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/common/annotation/Translation.java | 39 +++++++++++ .../common/annotation/TranslationType.java | 21 ++++++ .../com/ruoyi/common/constant/CacheNames.java | 10 +++ .../ruoyi/common/constant/TransConstant.java | 30 +++++++++ .../common/core/service/DeptService.java | 18 +++++ .../ruoyi/common/core/service/OssService.java | 18 +++++ .../common/core/service/UserService.java | 18 +++++ .../translation/TranslationInterface.java | 17 +++++ .../TranslationBeanSerializerModifier.java | 29 +++++++++ .../handler/TranslationHandler.java | 65 +++++++++++++++++++ .../impl/DeptNameTranslationImpl.java | 25 +++++++ .../impl/DictTypeTranslationImpl.java | 29 +++++++++ .../impl/OssUrlTranslationImpl.java | 25 +++++++ .../impl/UserNameTranslationImpl.java | 28 ++++++++ .../framework/config/TranslationConfig.java | 50 ++++++++++++++ .../service/impl/SysDeptServiceImpl.java | 33 +++++++++- .../service/impl/SysOssServiceImpl.java | 20 ++++-- .../service/impl/SysUserServiceImpl.java | 13 +++- 18 files changed, 480 insertions(+), 8 deletions(-) create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/annotation/Translation.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/annotation/TranslationType.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/constant/TransConstant.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/core/service/DeptService.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/core/service/OssService.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/core/service/UserService.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/translation/TranslationInterface.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/translation/handler/TranslationBeanSerializerModifier.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/translation/handler/TranslationHandler.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/DeptNameTranslationImpl.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/DictTypeTranslationImpl.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/OssUrlTranslationImpl.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/UserNameTranslationImpl.java create mode 100644 ruoyi-framework/src/main/java/com/ruoyi/framework/config/TranslationConfig.java diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Translation.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Translation.java new file mode 100644 index 000000000..ba8cd22ca --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Translation.java @@ -0,0 +1,39 @@ +package com.ruoyi.common.annotation; + +import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.ruoyi.common.translation.handler.TranslationHandler; + +import java.lang.annotation.*; + +/** + * 通用翻译注解 + * + * @author Lion Li + */ +@Inherited +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.FIELD, ElementType.METHOD}) +@Documented +@JacksonAnnotationsInside +@JsonSerialize(using = TranslationHandler.class) +public @interface Translation { + + /** + * 类型 (需与实现类上的 {@link com.ruoyi.common.annotation.TranslationType} 注解type对应) + *

+ * 默认取当前字段的值 如果设置了 @{@link Translation#mapper()} 则取映射字段的值 + */ + String type(); + + /** + * 映射字段 (如果不为空则取此字段的值) + */ + String mapper() default ""; + + /** + * 其他条件 例如: 字典type(sys_user_sex) + */ + String other() default ""; + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/TranslationType.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/TranslationType.java new file mode 100644 index 000000000..f592f6d80 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/TranslationType.java @@ -0,0 +1,21 @@ +package com.ruoyi.common.annotation; + +import java.lang.annotation.*; + +/** + * 翻译类型注解 (标注到{@link com.ruoyi.common.translation.TranslationInterface} 的实现类) + * + * @author Lion Li + */ +@Inherited +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE}) +@Documented +public @interface TranslationType { + + /** + * 类型 + */ + String type(); + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheNames.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheNames.java index 591ca2546..1396b6d18 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheNames.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheNames.java @@ -30,6 +30,16 @@ public interface CacheNames { */ String SYS_DICT = "sys_dict"; + /** + * 用户账户 + */ + String SYS_USER_NAME = "sys_user_name#30d"; + + /** + * 部门 + */ + String SYS_DEPT = "sys_dept#30d"; + /** * OSS内容 */ diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/TransConstant.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/TransConstant.java new file mode 100644 index 000000000..5c5e5f8e0 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/TransConstant.java @@ -0,0 +1,30 @@ +package com.ruoyi.common.constant; + +/** + * 翻译常量 + * + * @author Lion Li + */ +public interface TransConstant { + + /** + * 用户id转账号 + */ + String USER_ID_TO_NAME = "user_id_to_name"; + + /** + * 部门id转名称 + */ + String DEPT_ID_TO_NAME = "dept_id_to_name"; + + /** + * 字典type转label + */ + String DICT_TYPE_TO_LABEL = "dict_type_to_label"; + + /** + * ossId转url + */ + String OSS_ID_TO_URL = "oss_id_to_url"; + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/service/DeptService.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/service/DeptService.java new file mode 100644 index 000000000..c27f46182 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/service/DeptService.java @@ -0,0 +1,18 @@ +package com.ruoyi.common.core.service; + +/** + * 通用 部门服务 + * + * @author Lion Li + */ +public interface DeptService { + + /** + * 通过部门ID查询部门名称 + * + * @param deptIds 部门ID串逗号分隔 + * @return 部门名称串逗号分隔 + */ + String selectDeptNameByIds(String deptIds); + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/service/OssService.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/service/OssService.java new file mode 100644 index 000000000..65dda7c64 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/service/OssService.java @@ -0,0 +1,18 @@ +package com.ruoyi.common.core.service; + +/** + * 通用 OSS服务 + * + * @author Lion Li + */ +public interface OssService { + + /** + * 通过ossId查询对应的url + * + * @param ossIds ossId串逗号分隔 + * @return url串逗号分隔 + */ + String selectUrlByIds(String ossIds); + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/service/UserService.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/service/UserService.java new file mode 100644 index 000000000..d2206c8b0 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/service/UserService.java @@ -0,0 +1,18 @@ +package com.ruoyi.common.core.service; + +/** + * 通用 用户服务 + * + * @author Lion Li + */ +public interface UserService { + + /** + * 通过用户ID查询用户账户 + * + * @param userId 用户ID + * @return 用户账户 + */ + String selectUserNameById(Long userId); + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/translation/TranslationInterface.java b/ruoyi-common/src/main/java/com/ruoyi/common/translation/TranslationInterface.java new file mode 100644 index 000000000..4d59d7ec8 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/translation/TranslationInterface.java @@ -0,0 +1,17 @@ +package com.ruoyi.common.translation; + +/** + * 翻译接口 (实现类需标注 {@link com.ruoyi.common.annotation.TranslationType} 注解标明翻译类型) + * + * @author Lion Li + */ +public interface TranslationInterface { + + /** + * 翻译 + * + * @param key 需要被翻译的键(不为空) + * @return 返回键对应的值 + */ + String translation(Object key, String other); +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/translation/handler/TranslationBeanSerializerModifier.java b/ruoyi-common/src/main/java/com/ruoyi/common/translation/handler/TranslationBeanSerializerModifier.java new file mode 100644 index 000000000..0bcaf285e --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/translation/handler/TranslationBeanSerializerModifier.java @@ -0,0 +1,29 @@ +package com.ruoyi.common.translation.handler; + +import com.fasterxml.jackson.databind.BeanDescription; +import com.fasterxml.jackson.databind.SerializationConfig; +import com.fasterxml.jackson.databind.ser.BeanPropertyWriter; +import com.fasterxml.jackson.databind.ser.BeanSerializerModifier; + +import java.util.List; + +/** + * Bean 序列化修改器 解决 Null 被单独处理问题 + * + * @author Lion Li + */ +public class TranslationBeanSerializerModifier extends BeanSerializerModifier { + + @Override + public List changeProperties(SerializationConfig config, BeanDescription beanDesc, + List beanProperties) { + for (BeanPropertyWriter writer : beanProperties) { + // 如果序列化器为 TranslationHandler 的话 将 Null 值也交给他处理 + if (writer.getSerializer() instanceof TranslationHandler) { + writer.assignNullSerializer(writer.getSerializer()); + } + } + return beanProperties; + } + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/translation/handler/TranslationHandler.java b/ruoyi-common/src/main/java/com/ruoyi/common/translation/handler/TranslationHandler.java new file mode 100644 index 000000000..f6daa50c5 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/translation/handler/TranslationHandler.java @@ -0,0 +1,65 @@ +package com.ruoyi.common.translation.handler; + +import cn.hutool.core.util.ObjectUtil; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.BeanProperty; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.ContextualSerializer; +import com.ruoyi.common.annotation.Translation; +import com.ruoyi.common.translation.TranslationInterface; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.reflect.ReflectUtils; +import lombok.extern.slf4j.Slf4j; + +import java.io.IOException; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 翻译处理器 + * + * @author Lion Li + */ +@Slf4j +public class TranslationHandler extends JsonSerializer implements ContextualSerializer { + + /** + * 全局翻译实现类映射器 + */ + public static final Map TRANSLATION_MAPPER = new ConcurrentHashMap<>(); + + private Translation translation; + + @Override + public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers) throws IOException { + TranslationInterface trans = TRANSLATION_MAPPER.get(translation.type()); + if (ObjectUtil.isNotNull(trans)) { + // 如果映射字段不为空 则取映射字段的值 + if (StringUtils.isNotBlank(translation.mapper())) { + value = ReflectUtils.invokeGetter(gen.getCurrentValue(), translation.mapper()); + } + // 如果为 null 直接写出 + if (ObjectUtil.isNull(value)) { + gen.writeNull(); + return; + } + String result = trans.translation(value, translation.other()); + gen.writeString(result); + } else { + gen.writeObject(value); + } + } + + @Override + public JsonSerializer createContextual(SerializerProvider prov, BeanProperty property) throws JsonMappingException { + Translation translation = property.getAnnotation(Translation.class); + if (Objects.nonNull(translation)) { + this.translation = translation; + return this; + } + return prov.findValueSerializer(property.getType(), property); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/DeptNameTranslationImpl.java b/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/DeptNameTranslationImpl.java new file mode 100644 index 000000000..ed224381d --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/DeptNameTranslationImpl.java @@ -0,0 +1,25 @@ +package com.ruoyi.common.translation.impl; + +import com.ruoyi.common.annotation.TranslationType; +import com.ruoyi.common.constant.TransConstant; +import com.ruoyi.common.core.service.DeptService; +import com.ruoyi.common.translation.TranslationInterface; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Component; + +/** + * 部门翻译实现 + * + * @author Lion Li + */ +@Component +@AllArgsConstructor +@TranslationType(type = TransConstant.DEPT_ID_TO_NAME) +public class DeptNameTranslationImpl implements TranslationInterface { + + private final DeptService deptService; + + public String translation(Object key, String other) { + return deptService.selectDeptNameByIds(key.toString()); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/DictTypeTranslationImpl.java b/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/DictTypeTranslationImpl.java new file mode 100644 index 000000000..3928f7d0c --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/DictTypeTranslationImpl.java @@ -0,0 +1,29 @@ +package com.ruoyi.common.translation.impl; + +import com.ruoyi.common.annotation.TranslationType; +import com.ruoyi.common.constant.TransConstant; +import com.ruoyi.common.core.service.DictService; +import com.ruoyi.common.translation.TranslationInterface; +import com.ruoyi.common.utils.StringUtils; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Component; + +/** + * 字典翻译实现 + * + * @author Lion Li + */ +@Component +@AllArgsConstructor +@TranslationType(type = TransConstant.DICT_TYPE_TO_LABEL) +public class DictTypeTranslationImpl implements TranslationInterface { + + private final DictService dictService; + + public String translation(Object key, String other) { + if (key instanceof String && StringUtils.isNotBlank(other)) { + return dictService.getDictLabel(other, key.toString()); + } + return null; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/OssUrlTranslationImpl.java b/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/OssUrlTranslationImpl.java new file mode 100644 index 000000000..8b5aa7b3f --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/OssUrlTranslationImpl.java @@ -0,0 +1,25 @@ +package com.ruoyi.common.translation.impl; + +import com.ruoyi.common.annotation.TranslationType; +import com.ruoyi.common.constant.TransConstant; +import com.ruoyi.common.core.service.OssService; +import com.ruoyi.common.translation.TranslationInterface; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Component; + +/** + * OSS翻译实现 + * + * @author Lion Li + */ +@Component +@AllArgsConstructor +@TranslationType(type = TransConstant.OSS_ID_TO_URL) +public class OssUrlTranslationImpl implements TranslationInterface { + + private final OssService ossService; + + public String translation(Object key, String other) { + return ossService.selectUrlByIds(key.toString()); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/UserNameTranslationImpl.java b/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/UserNameTranslationImpl.java new file mode 100644 index 000000000..bda39b146 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/UserNameTranslationImpl.java @@ -0,0 +1,28 @@ +package com.ruoyi.common.translation.impl; + +import com.ruoyi.common.annotation.TranslationType; +import com.ruoyi.common.constant.TransConstant; +import com.ruoyi.common.core.service.UserService; +import com.ruoyi.common.translation.TranslationInterface; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Component; + +/** + * 用户名翻译实现 + * + * @author Lion Li + */ +@Component +@AllArgsConstructor +@TranslationType(type = TransConstant.USER_ID_TO_NAME) +public class UserNameTranslationImpl implements TranslationInterface { + + private final UserService userService; + + public String translation(Object key, String other) { + if (key instanceof Long) { + return userService.selectUserNameById((Long) key); + } + return null; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/TranslationConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/TranslationConfig.java new file mode 100644 index 000000000..ebed362d3 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/TranslationConfig.java @@ -0,0 +1,50 @@ +package com.ruoyi.framework.config; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.ruoyi.common.annotation.TranslationType; +import com.ruoyi.common.translation.TranslationInterface; +import com.ruoyi.common.translation.handler.TranslationBeanSerializerModifier; +import com.ruoyi.common.translation.handler.TranslationHandler; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; + +import javax.annotation.PostConstruct; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 翻译模块配置类 + * + * @author Lion Li + */ +@Slf4j +@Configuration +public class TranslationConfig { + + @Autowired + private List list; + + @Autowired + private ObjectMapper objectMapper; + + @PostConstruct + public void init() { + Map map = new HashMap<>(list.size()); + for (TranslationInterface trans : list) { + if (trans.getClass().isAnnotationPresent(TranslationType.class)) { + TranslationType annotation = trans.getClass().getAnnotation(TranslationType.class); + map.put(annotation.type(), trans); + } else { + log.warn(trans.getClass().getName() + " 翻译实现类未标注 TranslationType 注解!"); + } + } + TranslationHandler.TRANSLATION_MAPPER.putAll(map); + // 设置 Bean 序列化修改器 + objectMapper.setSerializerFactory( + objectMapper.getSerializerFactory() + .withSerializerModifier(new TranslationBeanSerializerModifier())); + } + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index afb7a3155..983d86287 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -6,25 +6,32 @@ import cn.hutool.core.lang.tree.Tree; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.ruoyi.common.constant.CacheNames; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.service.DeptService; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.helper.DataBaseHelper; import com.ruoyi.common.helper.LoginHelper; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.TreeBuildUtils; +import com.ruoyi.common.utils.redis.CacheUtils; +import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.system.mapper.SysDeptMapper; import com.ruoyi.system.mapper.SysRoleMapper; import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.system.service.ISysDeptService; import lombok.RequiredArgsConstructor; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.stream.Collectors; /** * 部门管理 服务实现 @@ -33,7 +40,7 @@ import java.util.List; */ @RequiredArgsConstructor @Service -public class SysDeptServiceImpl implements ISysDeptService { +public class SysDeptServiceImpl implements ISysDeptService, DeptService { private final SysDeptMapper baseMapper; private final SysRoleMapper roleMapper; @@ -106,6 +113,7 @@ public class SysDeptServiceImpl implements ISysDeptService { * @param deptId 部门ID * @return 部门信息 */ + @Cacheable(cacheNames = CacheNames.SYS_DEPT, key = "#deptId") @Override public SysDept selectDeptById(Long deptId) { SysDept dept = baseMapper.selectById(deptId); @@ -115,6 +123,24 @@ public class SysDeptServiceImpl implements ISysDeptService { return dept; } + /** + * 通过部门ID查询部门名称 + * + * @param deptIds 部门ID串逗号分隔 + * @return 部门名称串逗号分隔 + */ + @Override + public String selectDeptNameByIds(String deptIds) { + List list = new ArrayList<>(); + for (Long id : Arrays.stream(deptIds.split(",")).map(Long::parseLong).collect(Collectors.toList())) { + SysDept dept = SpringUtils.getAopProxy(this).selectDeptById(id); + if (ObjectUtil.isNotNull(dept)) { + list.add(dept.getDeptName()); + } + } + return String.join(",", list); + } + /** * 根据ID查询所有子部门数(正常状态) * @@ -260,7 +286,9 @@ public class SysDeptServiceImpl implements ISysDeptService { list.add(dept); } if (CollUtil.isNotEmpty(list)) { - baseMapper.updateBatchById(list); + if (baseMapper.updateBatchById(list)) { + list.forEach(dept -> CacheUtils.evict(CacheNames.SYS_DEPT, dept.getDeptId())); + } } } @@ -270,6 +298,7 @@ public class SysDeptServiceImpl implements ISysDeptService { * @param deptId 部门ID * @return 结果 */ + @CacheEvict(cacheNames = CacheNames.SYS_DEPT, key = "#deptId") @Override public int deleteDeptById(Long deptId) { return baseMapper.deleteById(deptId); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssServiceImpl.java index cd9bffb14..28328f3e9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssServiceImpl.java @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.constant.CacheNames; import com.ruoyi.common.core.domain.PageQuery; import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.core.service.OssService; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.BeanCopyUtils; import com.ruoyi.common.utils.StringUtils; @@ -31,10 +32,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -44,7 +42,7 @@ import java.util.stream.Collectors; */ @RequiredArgsConstructor @Service -public class SysOssServiceImpl implements ISysOssService { +public class SysOssServiceImpl implements ISysOssService, OssService { private final SysOssMapper baseMapper; @@ -69,6 +67,18 @@ public class SysOssServiceImpl implements ISysOssService { return list; } + @Override + public String selectUrlByIds(String ossIds) { + List list = new ArrayList<>(); + for (Long id : Arrays.stream(ossIds.split(",")).map(Long::parseLong).collect(Collectors.toList())) { + SysOssVo vo = SpringUtils.getAopProxy(this).getById(id); + if (ObjectUtil.isNotNull(vo)) { + list.add(this.matchingUrl(vo).getUrl()); + } + } + return String.join(",", list); + } + private LambdaQueryWrapper buildQueryWrapper(SysOssBo bo) { Map params = bo.getParams(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java index 862d029d3..8def3ff12 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -9,12 +9,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.constant.CacheNames; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.PageQuery; import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.core.service.UserService; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.helper.DataBaseHelper; import com.ruoyi.common.helper.LoginHelper; @@ -27,6 +29,7 @@ import com.ruoyi.system.mapper.*; import com.ruoyi.system.service.ISysUserService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -42,7 +45,7 @@ import java.util.Map; @Slf4j @RequiredArgsConstructor @Service -public class SysUserServiceImpl implements ISysUserService { +public class SysUserServiceImpl implements ISysUserService, UserService { private final SysUserMapper baseMapper; private final SysDeptMapper deptMapper; @@ -480,4 +483,12 @@ public class SysUserServiceImpl implements ISysUserService { return baseMapper.deleteBatchIds(ids); } + @Cacheable(cacheNames = CacheNames.SYS_USER_NAME, key = "#userId") + @Override + public String selectUserNameById(Long userId) { + SysUser sysUser = baseMapper.selectOne(new LambdaQueryWrapper() + .select(SysUser::getUserName).eq(SysUser::getUserId, userId)); + return ObjectUtil.isNull(sysUser) ? null : sysUser.getUserName(); + } + } From b9b76539ace219886b563bd2ec9c296b1c4a1a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Sun, 5 Feb 2023 13:20:05 +0800 Subject: [PATCH 07/34] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E6=9B=B4=E6=96=B0=E6=8E=A5=E5=8F=A3=20=E6=B8=85?= =?UTF-8?q?=E7=90=86=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/system/domain/bo/SysOssBo.java | 9 +++++++++ .../ruoyi/system/service/impl/SysDeptServiceImpl.java | 1 + 2 files changed, 10 insertions(+) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/bo/SysOssBo.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/bo/SysOssBo.java index 3f5ab4a8d..f874b20e3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/bo/SysOssBo.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/bo/SysOssBo.java @@ -13,22 +13,31 @@ import lombok.EqualsAndHashCode; @EqualsAndHashCode(callSuper = true) public class SysOssBo extends BaseEntity { + /** + * ossId + */ + private Long ossId; + /** * 文件名 */ private String fileName; + /** * 原名 */ private String originalName; + /** * 文件后缀名 */ private String fileSuffix; + /** * URL地址 */ private String url; + /** * 服务商 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index 983d86287..53b22a8be 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -236,6 +236,7 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService { * @param dept 部门信息 * @return 结果 */ + @CacheEvict(cacheNames = CacheNames.SYS_DEPT, key = "#dept.deptId") @Override public int updateDept(SysDept dept) { SysDept newParentDept = baseMapper.selectById(dept.getParentId()); From e803388cad8bd8e6336c3be8f1784859ba779f13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Mon, 6 Feb 2023 14:26:21 +0800 Subject: [PATCH 08/34] =?UTF-8?q?add=20=E6=96=B0=E5=A2=9E=20StringUtils=20?= =?UTF-8?q?splitTo=20=E4=B8=8E=20splitList=20=E6=96=B9=E6=B3=95=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=9A=E5=8A=A1=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/SysDeptController.java | 4 +- .../common/annotation/ExcelDictFormat.java | 4 +- .../ruoyi/common/core/domain/PageQuery.java | 4 +- .../com/ruoyi/common/filter/XssFilter.java | 2 +- .../com/ruoyi/common/utils/ServletUtils.java | 2 +- .../com/ruoyi/common/utils/StreamUtils.java | 2 +- .../com/ruoyi/common/utils/StringUtils.java | 72 ++++++++++++++++--- .../com/ruoyi/common/utils/poi/ExcelUtil.java | 4 +- .../ruoyi/framework/config/FilterConfig.java | 2 +- .../generator/domain/GenTableColumn.java | 2 +- .../com/ruoyi/generator/util/GenUtils.java | 6 +- .../ruoyi/generator/util/VelocityUtils.java | 2 +- .../ruoyi/sms/core/TencentSmsTemplate.java | 2 +- .../service/impl/SysDeptServiceImpl.java | 4 +- .../service/impl/SysMenuServiceImpl.java | 4 +- .../service/impl/SysRoleServiceImpl.java | 4 +- 16 files changed, 87 insertions(+), 33 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java index fa763df33..2acacbe8b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java @@ -1,7 +1,7 @@ package com.ruoyi.web.controller.system; import cn.dev33.satoken.annotation.SaCheckPermission; -import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.convert.Convert; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.controller.BaseController; @@ -49,7 +49,7 @@ public class SysDeptController extends BaseController { public R> excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) { List depts = deptService.selectDeptList(new SysDept()); depts.removeIf(d -> d.getDeptId().equals(deptId) - || ArrayUtil.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")); + || StringUtils.splitList(d.getAncestors()).contains(Convert.toStr(deptId))); return R.ok(depts); } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/ExcelDictFormat.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/ExcelDictFormat.java index 400080ea7..4bb0cc868 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/ExcelDictFormat.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/ExcelDictFormat.java @@ -1,5 +1,7 @@ package com.ruoyi.common.annotation; +import com.ruoyi.common.utils.StringUtils; + import java.lang.annotation.*; /** @@ -25,6 +27,6 @@ public @interface ExcelDictFormat { /** * 分隔符,读取字符串组内容 */ - String separator() default ","; + String separator() default StringUtils.SEPARATOR; } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/PageQuery.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/PageQuery.java index 60abde623..8a45905bb 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/PageQuery.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/PageQuery.java @@ -87,8 +87,8 @@ public class PageQuery implements Serializable { // 兼容前端排序类型 isAsc = StringUtils.replaceEach(isAsc, new String[]{"ascending", "descending"}, new String[]{"asc", "desc"}); - String[] orderByArr = orderBy.split(","); - String[] isAscArr = isAsc.split(","); + String[] orderByArr = orderBy.split(StringUtils.SEPARATOR); + String[] isAscArr = isAsc.split(StringUtils.SEPARATOR); if (isAscArr.length != 1 && isAscArr.length != orderByArr.length) { throw new ServiceException("排序参数有误"); } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java b/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java index 5a0879472..72772c1b3 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java @@ -25,7 +25,7 @@ public class XssFilter implements Filter { public void init(FilterConfig filterConfig) throws ServletException { String tempExcludes = filterConfig.getInitParameter("excludes"); if (StringUtils.isNotEmpty(tempExcludes)) { - String[] url = tempExcludes.split(","); + String[] url = tempExcludes.split(StringUtils.SEPARATOR); for (int i = 0; url != null && i < url.length; i++) { excludes.add(url[i]); } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java index 91ddd3f66..288a1a1a2 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java @@ -94,7 +94,7 @@ public class ServletUtils extends ServletUtil { public static Map getParamMap(ServletRequest request) { Map params = new HashMap<>(); for (Map.Entry entry : getParams(request).entrySet()) { - params.put(entry.getKey(), StringUtils.join(entry.getValue(), ",")); + params.put(entry.getKey(), StringUtils.join(entry.getValue(), StringUtils.SEPARATOR)); } return params; } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/StreamUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/StreamUtils.java index fccd9e3d1..a03e5bee4 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/StreamUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/StreamUtils.java @@ -41,7 +41,7 @@ public class StreamUtils { * @return 拼接后的list */ public static String join(Collection collection, Function function) { - return join(collection, function, ","); + return join(collection, function, StringUtils.SEPARATOR); } /** diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java index 16f8861c1..2a5bd488b 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java @@ -1,16 +1,16 @@ package com.ruoyi.common.utils; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.convert.Convert; import cn.hutool.core.lang.Validator; import cn.hutool.core.util.StrUtil; import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.springframework.util.AntPathMatcher; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; /** * 字符串工具类 @@ -20,6 +20,8 @@ import java.util.Set; @NoArgsConstructor(access = AccessLevel.PRIVATE) public class StringUtils extends org.apache.commons.lang3.StringUtils { + public static final String SEPARATOR = ","; + /** * 获取参数不为空值 * @@ -224,7 +226,6 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils { * * @param pattern 匹配规则 * @param url 需要匹配的url - * @return */ public static boolean isMatch(String pattern, String url) { AntPathMatcher matcher = new AntPathMatcher(); @@ -234,23 +235,23 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils { /** * 数字左边补齐0,使之达到指定长度。注意,如果数字转换为字符串后,长度大于size,则只保留 最后size个字符。 * - * @param num 数字对象 + * @param num 数字对象 * @param size 字符串指定长度 * @return 返回数字的字符串格式,该字符串为指定长度。 */ - public static final String padl(final Number num, final int size) { + public static String padl(final Number num, final int size) { return padl(num.toString(), size, '0'); } /** * 字符串左补齐。如果原始字符串s长度大于size,则只保留最后size个字符。 * - * @param s 原始字符串 + * @param s 原始字符串 * @param size 字符串指定长度 - * @param c 用于补齐的字符 + * @param c 用于补齐的字符 * @return 返回指定长度的字符串,由原字符串左补齐或截取得到。 */ - public static final String padl(final String s, final int size, final char c) { + public static String padl(final String s, final int size, final char c) { final StringBuilder sb = new StringBuilder(size); if (s != null) { final int len = s.length(); @@ -270,4 +271,55 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils { return sb.toString(); } + /** + * 切分字符串(分隔符默认逗号) + * + * @param str 被切分的字符串 + * @return 分割后的数据列表 + */ + public static List splitList(String str) { + return splitTo(str, Convert::toStr); + } + + /** + * 切分字符串 + * + * @param str 被切分的字符串 + * @param separator 分隔符 + * @return 分割后的数据列表 + */ + public static List splitList(String str, String separator) { + return splitTo(str, separator, Convert::toStr); + } + + /** + * 切分字符串自定义转换(分隔符默认逗号) + * + * @param str 被切分的字符串 + * @param mapper 自定义转换 + * @return 分割后的数据列表 + */ + public static List splitTo(String str, Function mapper) { + return splitTo(str, SEPARATOR, mapper); + } + + /** + * 切分字符串自定义转换 + * + * @param str 被切分的字符串 + * @param separator 分隔符 + * @param mapper 自定义转换 + * @return 分割后的数据列表 + */ + public static List splitTo(String str, String separator, Function mapper) { + if (isBlank(str)) { + return new ArrayList<>(0); + } + return StrUtil.split(str, separator) + .stream() + .filter(Objects::nonNull) + .map(mapper) + .collect(Collectors.toList()); + } + } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java index 211c6214c..cf2ba885c 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java @@ -270,7 +270,7 @@ public class ExcelUtil { */ public static String convertByExp(String propertyValue, String converterExp, String separator) { StringBuilder propertyString = new StringBuilder(); - String[] convertSource = converterExp.split(","); + String[] convertSource = converterExp.split(StringUtils.SEPARATOR); for (String item : convertSource) { String[] itemArray = item.split("="); if (StringUtils.containsAny(propertyValue, separator)) { @@ -299,7 +299,7 @@ public class ExcelUtil { */ public static String reverseByExp(String propertyValue, String converterExp, String separator) { StringBuilder propertyString = new StringBuilder(); - String[] convertSource = converterExp.split(","); + String[] convertSource = converterExp.split(StringUtils.SEPARATOR); for (String item : convertSource) { String[] itemArray = item.split("="); if (StringUtils.containsAny(propertyValue, separator)) { diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FilterConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FilterConfig.java index 6f3b099ab..0770c2162 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FilterConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FilterConfig.java @@ -32,7 +32,7 @@ public class FilterConfig { FilterRegistrationBean registration = new FilterRegistrationBean(); registration.setDispatcherTypes(DispatcherType.REQUEST); registration.setFilter(new XssFilter()); - registration.addUrlPatterns(StringUtils.split(xssProperties.getUrlPatterns(), ",")); + registration.addUrlPatterns(StringUtils.split(xssProperties.getUrlPatterns(), StringUtils.SEPARATOR)); registration.setName("xssFilter"); registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE); Map initParameters = new HashMap(); diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java index 280204b55..f6dbcaaf4 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java @@ -212,7 +212,7 @@ public class GenTableColumn extends BaseEntity { if (StringUtils.isNotEmpty(value)) { Object startStr = value.subSequence(0, 1); String endStr = value.substring(1); - sb.append("").append(startStr).append("=").append(endStr).append(","); + sb.append(StringUtils.EMPTY).append(startStr).append("=").append(endStr).append(StringUtils.SEPARATOR); } } return sb.deleteCharAt(sb.length() - 1).toString(); diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java index b6c2248e6..f04beb983 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java @@ -58,7 +58,7 @@ public class GenUtils { column.setHtmlType(GenConstants.HTML_INPUT); // 如果是浮点型 统一用BigDecimal - String[] str = StringUtils.split(StringUtils.substringBetween(column.getColumnType(), "(", ")"), ","); + String[] str = StringUtils.split(StringUtils.substringBetween(column.getColumnType(), "(", ")"), StringUtils.SEPARATOR); if (str != null && str.length == 2 && Integer.parseInt(str[1]) > 0) { column.setJavaType(GenConstants.TYPE_BIGDECIMAL); } @@ -167,7 +167,7 @@ public class GenUtils { boolean autoRemovePre = GenConfig.getAutoRemovePre(); String tablePrefix = GenConfig.getTablePrefix(); if (autoRemovePre && StringUtils.isNotEmpty(tablePrefix)) { - String[] searchList = StringUtils.split(tablePrefix, ","); + String[] searchList = StringUtils.split(tablePrefix, StringUtils.SEPARATOR); tableName = replaceFirst(tableName, searchList); } return StringUtils.convertToCamelCase(tableName); @@ -184,7 +184,7 @@ public class GenUtils { String text = replacementm; for (String searchString : searchList) { if (replacementm.startsWith(searchString)) { - text = replacementm.replaceFirst(searchString, ""); + text = replacementm.replaceFirst(searchString, StringUtils.EMPTY); break; } } diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java index d8eeb6dd7..2277e2c38 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java @@ -232,7 +232,7 @@ public class VelocityUtils { public static HashSet getImportList(GenTable genTable) { List columns = genTable.getColumns(); GenTable subGenTable = genTable.getSubTable(); - HashSet importList = new HashSet(); + HashSet importList = new HashSet<>(); if (ObjectUtil.isNotNull(subGenTable)) { importList.add("java.util.List"); } diff --git a/ruoyi-sms/src/main/java/com/ruoyi/sms/core/TencentSmsTemplate.java b/ruoyi-sms/src/main/java/com/ruoyi/sms/core/TencentSmsTemplate.java index 17f5b5b16..69ec7f1ec 100644 --- a/ruoyi-sms/src/main/java/com/ruoyi/sms/core/TencentSmsTemplate.java +++ b/ruoyi-sms/src/main/java/com/ruoyi/sms/core/TencentSmsTemplate.java @@ -53,7 +53,7 @@ public class TencentSmsTemplate implements SmsTemplate { throw new SmsException("模板ID不能为空"); } SendSmsRequest req = new SendSmsRequest(); - Set set = Arrays.stream(phones.split(",")).map(p -> "+86" + p).collect(Collectors.toSet()); + Set set = Arrays.stream(phones.split(StringUtils.SEPARATOR)).map(p -> "+86" + p).collect(Collectors.toSet()); req.setPhoneNumberSet(ArrayUtil.toArray(set, String.class)); if (CollUtil.isNotEmpty(param)) { req.setTemplateParamSet(ArrayUtil.toArray(param.values(), String.class)); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index 53b22a8be..cb5fb6c57 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -226,7 +226,7 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService { if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) { throw new ServiceException("部门停用,不允许新增"); } - dept.setAncestors(info.getAncestors() + "," + dept.getParentId()); + dept.setAncestors(info.getAncestors() + StringUtils.SEPARATOR + dept.getParentId()); return baseMapper.insert(dept); } @@ -242,7 +242,7 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService { SysDept newParentDept = baseMapper.selectById(dept.getParentId()); SysDept oldDept = baseMapper.selectById(dept.getDeptId()); if (ObjectUtil.isNotNull(newParentDept) && ObjectUtil.isNotNull(oldDept)) { - String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId(); + String newAncestors = newParentDept.getAncestors() + StringUtils.SEPARATOR + newParentDept.getDeptId(); String oldAncestors = oldDept.getAncestors(); dept.setAncestors(newAncestors); updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java index 4056d5670..83cf2d13a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java @@ -92,7 +92,7 @@ public class SysMenuServiceImpl implements ISysMenuService { Set permsSet = new HashSet<>(); for (String perm : perms) { if (StringUtils.isNotEmpty(perm)) { - permsSet.addAll(Arrays.asList(perm.trim().split(","))); + permsSet.addAll(StringUtils.splitList(perm.trim())); } } return permsSet; @@ -110,7 +110,7 @@ public class SysMenuServiceImpl implements ISysMenuService { Set permsSet = new HashSet<>(); for (String perm : perms) { if (StringUtils.isNotEmpty(perm)) { - permsSet.addAll(Arrays.asList(perm.trim().split(","))); + permsSet.addAll(StringUtils.splitList(perm.trim())); } } return permsSet; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java index 9e85bee57..35bae606a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java @@ -5,7 +5,6 @@ import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.constant.UserConstants; @@ -15,6 +14,7 @@ import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.helper.LoginHelper; import com.ruoyi.common.utils.StreamUtils; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.domain.SysRoleDept; import com.ruoyi.system.domain.SysRoleMenu; import com.ruoyi.system.domain.SysUserRole; @@ -107,7 +107,7 @@ public class SysRoleServiceImpl implements ISysRoleService { Set permsSet = new HashSet<>(); for (SysRole perm : perms) { if (ObjectUtil.isNotNull(perm)) { - permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(","))); + permsSet.addAll(StringUtils.splitList(perm.getRoleKey().trim())); } } return permsSet; From 57bcb5dbf6a607f6929209c54efb1690d6299165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Mon, 6 Feb 2023 15:50:09 +0800 Subject: [PATCH 09/34] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20oss=20dept?= =?UTF-8?q?=20=E4=B8=9A=E5=8A=A1=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/system/service/impl/SysDeptServiceImpl.java | 5 ++--- .../com/ruoyi/system/service/impl/SysOssServiceImpl.java | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index cb5fb6c57..ac934f90f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -31,7 +31,6 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.stream.Collectors; /** * 部门管理 服务实现 @@ -132,13 +131,13 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService { @Override public String selectDeptNameByIds(String deptIds) { List list = new ArrayList<>(); - for (Long id : Arrays.stream(deptIds.split(",")).map(Long::parseLong).collect(Collectors.toList())) { + for (Long id : StringUtils.splitTo(deptIds, Convert::toLong)) { SysDept dept = SpringUtils.getAopProxy(this).selectDeptById(id); if (ObjectUtil.isNotNull(dept)) { list.add(dept.getDeptName()); } } - return String.join(",", list); + return String.join(StringUtils.SEPARATOR, list); } /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssServiceImpl.java index 28328f3e9..c36bfa274 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssServiceImpl.java @@ -1,5 +1,6 @@ package com.ruoyi.system.service.impl; +import cn.hutool.core.convert.Convert; import cn.hutool.core.io.IoUtil; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -70,13 +71,13 @@ public class SysOssServiceImpl implements ISysOssService, OssService { @Override public String selectUrlByIds(String ossIds) { List list = new ArrayList<>(); - for (Long id : Arrays.stream(ossIds.split(",")).map(Long::parseLong).collect(Collectors.toList())) { + for (Long id : StringUtils.splitTo(ossIds, Convert::toLong)) { SysOssVo vo = SpringUtils.getAopProxy(this).getById(id); if (ObjectUtil.isNotNull(vo)) { list.add(this.matchingUrl(vo).getUrl()); } } - return String.join(",", list); + return String.join(StringUtils.SEPARATOR, list); } private LambdaQueryWrapper buildQueryWrapper(SysOssBo bo) { From 5cf32870648ba4016c54d98c637aa5e4f9deb1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Tue, 7 Feb 2023 13:11:28 +0800 Subject: [PATCH 10/34] update springboot 2.7.7 => 2.7.8 update easyexcel 3.1.5 => 3.2.0 update redisson 3.19.1 => 3.19.2 update aws-java-sdk-s3 1.12.373 => 1.12.400 update tencent-sms 3.1.660 => 3.1.687 --- pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index a897d31d9..18412bf95 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ 4.5.0 - 2.7.7 + 2.7.8 UTF-8 UTF-8 1.8 @@ -22,7 +22,7 @@ 2.2.2 1.6.14 5.2.3 - 3.1.5 + 3.2.0 2.3 1.34.0 3.5.3.1 @@ -30,7 +30,7 @@ 5.8.11 4.10.0 2.7.10 - 3.19.1 + 3.19.2 2.2.3 3.5.2 2.14.2 @@ -42,10 +42,10 @@ 1.33 - 1.12.373 + 1.12.400 2.0.23 - 3.1.660 + 3.1.687 From 1f507f2d22cbcb4328732f24a2602f873730da86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Tue, 7 Feb 2023 19:06:42 +0800 Subject: [PATCH 11/34] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E8=8F=9C=E5=8D=95=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=20=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E5=B1=9E=E6=80=A7=E4=B8=8E=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/common/core/domain/entity/SysRole.java | 7 ------- .../system/service/SysPermissionService.java | 15 +-------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java index a78cb03e7..594956998 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java @@ -17,7 +17,6 @@ import lombok.NoArgsConstructor; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; -import java.util.Set; /** * 角色表 sys_role @@ -115,12 +114,6 @@ public class SysRole extends BaseEntity { @TableField(exist = false) private Long[] deptIds; - /** - * 角色菜单权限 - */ - @TableField(exist = false) - private Set permissions; - public SysRole(Long roleId) { this.roleId = roleId; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/SysPermissionService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/SysPermissionService.java index 79d6e2522..5adc63225 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/SysPermissionService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/SysPermissionService.java @@ -1,13 +1,10 @@ package com.ruoyi.system.service; -import cn.hutool.core.collection.CollUtil; -import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysUser; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import java.util.HashSet; -import java.util.List; import java.util.Set; /** @@ -51,17 +48,7 @@ public class SysPermissionService { if (user.isAdmin()) { perms.add("*:*:*"); } else { - List roles = user.getRoles(); - if (CollUtil.isNotEmpty(roles)) { - // 多角色设置permissions属性,以便数据权限匹配权限 - for (SysRole role : roles) { - Set rolePerms = menuService.selectMenuPermsByRoleId(role.getRoleId()); - role.setPermissions(rolePerms); - perms.addAll(rolePerms); - } - } else { - perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId())); - } + perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId())); } return perms; } From c203d0af46a564cc33fe8dd02d4f1ac2e0050e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Wed, 8 Feb 2023 10:39:15 +0800 Subject: [PATCH 12/34] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E8=BF=9E=E6=8E=A5=E6=B1=A0=E6=9C=80=E9=95=BF=E7=94=9F?= =?UTF-8?q?=E5=91=BD=E5=91=A8=E6=9C=9F=20=E9=98=B2=E6=AD=A2=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-admin/src/main/resources/application-dev.yml | 2 +- ruoyi-admin/src/main/resources/application-prod.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ruoyi-admin/src/main/resources/application-dev.yml b/ruoyi-admin/src/main/resources/application-dev.yml index 1db59bbc7..63e8741fa 100644 --- a/ruoyi-admin/src/main/resources/application-dev.yml +++ b/ruoyi-admin/src/main/resources/application-dev.yml @@ -92,7 +92,7 @@ spring: # 空闲连接存活最大时间,默认10分钟 idleTimeout: 600000 # 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟 - maxLifetime: 900000 + maxLifetime: 1800000 # 连接测试query(配置检测连接是否有效) connectionTestQuery: SELECT 1 diff --git a/ruoyi-admin/src/main/resources/application-prod.yml b/ruoyi-admin/src/main/resources/application-prod.yml index 0852d4199..18f62d889 100644 --- a/ruoyi-admin/src/main/resources/application-prod.yml +++ b/ruoyi-admin/src/main/resources/application-prod.yml @@ -95,7 +95,7 @@ spring: # 空闲连接存活最大时间,默认10分钟 idleTimeout: 600000 # 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟 - maxLifetime: 900000 + maxLifetime: 1800000 # 连接测试query(配置检测连接是否有效) connectionTestQuery: SELECT 1 From d2baaaaf7b0f0c98ebff7328afe85f14ef2692e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Thu, 9 Feb 2023 12:38:56 +0800 Subject: [PATCH 13/34] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E6=B1=A0=E5=A2=9E=E5=8A=A0=20keepaliveTime=20?= =?UTF-8?q?=E6=8E=A2=E6=B4=BB=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-admin/src/main/resources/application-dev.yml | 2 ++ ruoyi-admin/src/main/resources/application-prod.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ruoyi-admin/src/main/resources/application-dev.yml b/ruoyi-admin/src/main/resources/application-dev.yml index 63e8741fa..32123a764 100644 --- a/ruoyi-admin/src/main/resources/application-dev.yml +++ b/ruoyi-admin/src/main/resources/application-dev.yml @@ -95,6 +95,8 @@ spring: maxLifetime: 1800000 # 连接测试query(配置检测连接是否有效) connectionTestQuery: SELECT 1 + # 多久检查一次连接的活性 + keepaliveTime: 30000 --- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉) spring: diff --git a/ruoyi-admin/src/main/resources/application-prod.yml b/ruoyi-admin/src/main/resources/application-prod.yml index 18f62d889..85f6e935d 100644 --- a/ruoyi-admin/src/main/resources/application-prod.yml +++ b/ruoyi-admin/src/main/resources/application-prod.yml @@ -98,6 +98,8 @@ spring: maxLifetime: 1800000 # 连接测试query(配置检测连接是否有效) connectionTestQuery: SELECT 1 + # 多久检查一次连接的活性 + keepaliveTime: 30000 --- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉) spring: From f3d800d59861cd01b41c2ed70afccdb13918d4dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Thu, 9 Feb 2023 13:53:29 +0800 Subject: [PATCH 14/34] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20DataPermiss?= =?UTF-8?q?ionHelper=20=E5=A2=9E=E5=8A=A0=20=E5=BC=80=E5=90=AF/=E5=85=B3?= =?UTF-8?q?=E9=97=AD=20=E5=BF=BD=E7=95=A5=E6=95=B0=E6=8D=AE=E6=9D=83?= =?UTF-8?q?=E9=99=90=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/helper/DataPermissionHelper.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/helper/DataPermissionHelper.java b/ruoyi-common/src/main/java/com/ruoyi/common/helper/DataPermissionHelper.java index 0e60485ad..e2b1129f5 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/helper/DataPermissionHelper.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/helper/DataPermissionHelper.java @@ -3,6 +3,8 @@ package com.ruoyi.common.helper; import cn.dev33.satoken.context.SaHolder; import cn.dev33.satoken.context.model.SaStorage; import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.plugins.IgnoreStrategy; +import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper; import lombok.AccessLevel; import lombok.NoArgsConstructor; @@ -44,4 +46,19 @@ public class DataPermissionHelper { } throw new NullPointerException("data permission context type exception"); } + + /** + * 开启忽略数据权限(开启后需手动调用 {@link #disableIgnore()} 关闭) + */ + public static void enableIgnore() { + InterceptorIgnoreHelper.handle(IgnoreStrategy.builder().dataPermission(true).build()); + } + + /** + * 关闭忽略数据权限 + */ + public static void disableIgnore() { + InterceptorIgnoreHelper.clearIgnoreStrategy(); + } + } From d93307151ac1ada2118aea67c8a694f0167ae119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Wed, 15 Feb 2023 11:39:36 +0800 Subject: [PATCH 15/34] =?UTF-8?q?update=20=E9=87=8D=E6=9E=84=20=E5=B0=86?= =?UTF-8?q?=20LoginUser=20=E6=95=B0=E6=8D=AE=E5=AD=98=E5=82=A8=E5=88=B0=20?= =?UTF-8?q?token=20=E5=86=85=E9=83=A8=20=E5=87=8F=E5=B0=91=20redis=20?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E4=B8=8E=E6=9F=A5=E8=AF=A2(=E5=BC=8A?= =?UTF-8?q?=E7=AB=AF=E4=B8=8D=E5=8F=AF=E6=9B=B4=E6=96=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/SysRoleController.java | 10 ---------- .../com/ruoyi/common/helper/LoginHelper.java | 20 ++++++++----------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java index 00a8a008b..88bb900bc 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java @@ -1,7 +1,6 @@ package com.ruoyi.web.controller.system; import cn.dev33.satoken.annotation.SaCheckPermission; -import cn.hutool.core.util.ObjectUtil; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.controller.BaseController; @@ -10,10 +9,8 @@ import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.helper.LoginHelper; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.service.ISysDeptService; @@ -109,13 +106,6 @@ public class SysRoleController extends BaseController { } if (roleService.updateRole(role) > 0) { - // 更新缓存用户权限 - LoginUser loginUser = getLoginUser(); - SysUser sysUser = userService.selectUserById(loginUser.getUserId()); - if (ObjectUtil.isNotNull(sysUser) && !LoginHelper.isAdmin()) { - loginUser.setMenuPermission(permissionService.getMenuPermission(sysUser)); - LoginHelper.setLoginUser(loginUser); - } return R.ok(); } return R.fail("修改角色'" + role.getRoleName() + "'失败,请联系管理员"); diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java b/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java index cee0e93ae..a4ed27575 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java @@ -1,8 +1,10 @@ package com.ruoyi.common.helper; import cn.dev33.satoken.context.SaHolder; +import cn.dev33.satoken.stp.SaLoginModel; import cn.dev33.satoken.stp.StpUtil; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.json.JSONObject; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.enums.DeviceType; @@ -37,8 +39,7 @@ public class LoginHelper { */ public static void login(LoginUser loginUser) { SaHolder.getStorage().set(LOGIN_USER_KEY, loginUser); - StpUtil.login(loginUser.getLoginId()); - setLoginUser(loginUser); + StpUtil.login(loginUser.getLoginId(), new SaLoginModel().setExtra(LOGIN_USER_KEY, loginUser)); } /** @@ -49,15 +50,10 @@ public class LoginHelper { */ public static void loginByDevice(LoginUser loginUser, DeviceType deviceType) { SaHolder.getStorage().set(LOGIN_USER_KEY, loginUser); - StpUtil.login(loginUser.getLoginId(), deviceType.getDevice()); - setLoginUser(loginUser); - } - - /** - * 设置用户数据(多级缓存) - */ - public static void setLoginUser(LoginUser loginUser) { - StpUtil.getTokenSession().set(LOGIN_USER_KEY, loginUser); + StpUtil.login(loginUser.getLoginId(), + new SaLoginModel() + .setDevice(deviceType.getDevice()) + .setExtra(LOGIN_USER_KEY, loginUser)); } /** @@ -68,7 +64,7 @@ public class LoginHelper { if (loginUser != null) { return loginUser; } - loginUser = (LoginUser) StpUtil.getTokenSession().get(LOGIN_USER_KEY); + loginUser = ((JSONObject) StpUtil.getExtra(LOGIN_USER_KEY)).toBean(LoginUser.class); SaHolder.getStorage().set(LOGIN_USER_KEY, loginUser); return loginUser; } From 4382cf2217d145aa91efeea8ddcc790ec6b11d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Wed, 15 Feb 2023 11:46:14 +0800 Subject: [PATCH 16/34] =?UTF-8?q?update=20=E9=87=8D=E6=9E=84=20OssFactory?= =?UTF-8?q?=20=E5=8A=A0=E8=BD=BD=E6=96=B9=E5=BC=8F=20=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E6=AF=8F=E6=AC=A1=E6=AF=94=E5=AF=B9=E9=85=8D=E7=BD=AE=E5=81=9A?= =?UTF-8?q?=E5=AE=9E=E4=BE=8B=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/oss/core/OssClient.java | 13 ++++++ .../com/ruoyi/oss/factory/OssFactory.java | 42 ++++++------------- .../service/impl/SysOssConfigServiceImpl.java | 23 ++-------- 3 files changed, 29 insertions(+), 49 deletions(-) diff --git a/ruoyi-oss/src/main/java/com/ruoyi/oss/core/OssClient.java b/ruoyi-oss/src/main/java/com/ruoyi/oss/core/OssClient.java index fe409ce7d..a82853e9c 100644 --- a/ruoyi-oss/src/main/java/com/ruoyi/oss/core/OssClient.java +++ b/ruoyi-oss/src/main/java/com/ruoyi/oss/core/OssClient.java @@ -183,6 +183,12 @@ public class OssClient { return configKey; } + /** + * 获取私有URL链接 + * + * @param objectKey 对象KEY + * @param second 授权时间 + */ public String getPrivateUrl(String objectKey, Integer second) { GeneratePresignedUrlRequest generatePresignedUrlRequest = new GeneratePresignedUrlRequest(properties.getBucketName(), objectKey) @@ -192,6 +198,13 @@ public class OssClient { return url.toString(); } + /** + * 检查配置是否相同 + */ + public boolean checkPropertiesSame(OssProperties properties) { + return this.properties.equals(properties); + } + /** * 获取当前桶权限类型 * diff --git a/ruoyi-oss/src/main/java/com/ruoyi/oss/factory/OssFactory.java b/ruoyi-oss/src/main/java/com/ruoyi/oss/factory/OssFactory.java index c3312d730..78b53529f 100644 --- a/ruoyi-oss/src/main/java/com/ruoyi/oss/factory/OssFactory.java +++ b/ruoyi-oss/src/main/java/com/ruoyi/oss/factory/OssFactory.java @@ -24,21 +24,6 @@ public class OssFactory { private static final Map CLIENT_CACHE = new ConcurrentHashMap<>(); - /** - * 初始化工厂 - */ - public static void init() { - log.info("初始化OSS工厂"); - RedisUtils.subscribe(OssConstant.DEFAULT_CONFIG_KEY, String.class, configKey -> { - OssClient client = getClient(configKey); - // 未初始化不处理 - if (client != null) { - refresh(configKey); - log.info("订阅刷新OSS配置 => " + configKey); - } - }); - } - /** * 获取默认实例 */ @@ -55,25 +40,24 @@ public class OssFactory { * 根据类型获取实例 */ public static OssClient instance(String configKey) { - OssClient client = getClient(configKey); - if (client == null) { - refresh(configKey); - return getClient(configKey); - } - return client; - } - - private static void refresh(String configKey) { String json = CacheUtils.get(CacheNames.SYS_OSS_CONFIG, configKey); if (json == null) { throw new OssException("系统异常, '" + configKey + "'配置信息不存在!"); } OssProperties properties = JsonUtils.parseObject(json, OssProperties.class); - CLIENT_CACHE.put(configKey, new OssClient(configKey, properties)); - } - - private static OssClient getClient(String configKey) { - return CLIENT_CACHE.get(configKey); + OssClient client = CLIENT_CACHE.get(configKey); + if (client == null) { + CLIENT_CACHE.put(configKey, new OssClient(configKey, properties)); + log.info("创建OSS实例 key => {}", configKey); + return CLIENT_CACHE.get(configKey); + } + // 配置不相同则重新构建 + if (!client.checkPropertiesSame(properties)) { + CLIENT_CACHE.put(configKey, new OssClient(configKey, properties)); + log.info("重载OSS实例 key => {}", configKey); + return CLIENT_CACHE.get(configKey); + } + return client; } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssConfigServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssConfigServiceImpl.java index d6269242c..b43908434 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssConfigServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssConfigServiceImpl.java @@ -16,9 +16,7 @@ import com.ruoyi.common.utils.JsonUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.redis.CacheUtils; import com.ruoyi.common.utils.redis.RedisUtils; -import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.oss.constant.OssConstant; -import com.ruoyi.oss.factory.OssFactory; import com.ruoyi.system.domain.SysOssConfig; import com.ruoyi.system.domain.bo.SysOssConfigBo; import com.ruoyi.system.domain.vo.SysOssConfigVo; @@ -26,7 +24,6 @@ import com.ruoyi.system.mapper.SysOssConfigMapper; import com.ruoyi.system.service.ISysOssConfigService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.context.event.EventListener; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -59,10 +56,8 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService { if ("0".equals(config.getStatus())) { RedisUtils.setCacheObject(OssConstant.DEFAULT_CONFIG_KEY, configKey); } - SpringUtils.context().publishEvent(config); + CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); } - // 初始化OSS工厂 - OssFactory.init(); } @Override @@ -92,7 +87,7 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService { validEntityBeforeSave(config); boolean flag = baseMapper.insert(config) > 0; if (flag) { - SpringUtils.context().publishEvent(config); + CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); } return flag; } @@ -109,7 +104,7 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService { luw.eq(SysOssConfig::getOssConfigId, config.getOssConfigId()); boolean flag = baseMapper.update(config, luw) > 0; if (flag) { - SpringUtils.context().publishEvent(config); + CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); } return flag; } @@ -174,16 +169,4 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService { return row; } - /** - * 更新配置缓存 - * - * @param config 配置 - */ - @EventListener - public void updateConfigCache(SysOssConfig config) { - CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); - RedisUtils.publish(OssConstant.DEFAULT_CONFIG_KEY, config.getConfigKey(), msg -> { - log.info("发布刷新OSS配置 => " + msg); - }); - } } From db6796e74075b7f4fb80be3906fbd8347237ec84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Wed, 15 Feb 2023 12:53:18 +0800 Subject: [PATCH 17/34] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20SaToken=20?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=89=A9=E5=B1=95=E7=B1=BB=20?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E9=85=8D=E7=BD=AE=E7=B1=BB=E6=B3=A8=E5=85=A5?= =?UTF-8?q?=20=E4=BE=BF=E4=BA=8E=E6=89=A9=E5=B1=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/framework/config/SaTokenConfig.java | 20 +++++++++++++++++++ .../framework/satoken/dao/PlusSaTokenDao.java | 2 -- .../satoken/service/SaPermissionImpl.java | 2 -- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SaTokenConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SaTokenConfig.java index 291228667..40eb87c4c 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SaTokenConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SaTokenConfig.java @@ -1,11 +1,15 @@ package com.ruoyi.framework.config; +import cn.dev33.satoken.dao.SaTokenDao; import cn.dev33.satoken.interceptor.SaInterceptor; import cn.dev33.satoken.jwt.StpLogicJwtForSimple; import cn.dev33.satoken.router.SaRouter; +import cn.dev33.satoken.stp.StpInterface; import cn.dev33.satoken.stp.StpLogic; import cn.dev33.satoken.stp.StpUtil; import com.ruoyi.framework.config.properties.SecurityProperties; +import com.ruoyi.framework.satoken.dao.PlusSaTokenDao; +import com.ruoyi.framework.satoken.service.SaPermissionImpl; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Bean; @@ -59,4 +63,20 @@ public class SaTokenConfig implements WebMvcConfigurer { return new StpLogicJwtForSimple(); } + /** + * 权限接口实现(使用bean注入方便用户替换) + */ + @Bean + public StpInterface stpInterface() { + return new SaPermissionImpl(); + } + + /** + * 自定义dao层存储 + */ + @Bean + public SaTokenDao saTokenDao() { + return new PlusSaTokenDao(); + } + } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/satoken/dao/PlusSaTokenDao.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/satoken/dao/PlusSaTokenDao.java index 83c3d5455..2e4e89025 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/satoken/dao/PlusSaTokenDao.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/satoken/dao/PlusSaTokenDao.java @@ -3,7 +3,6 @@ package com.ruoyi.framework.satoken.dao; import cn.dev33.satoken.dao.SaTokenDao; import cn.dev33.satoken.util.SaFoxUtil; import com.ruoyi.common.utils.redis.RedisUtils; -import org.springframework.stereotype.Component; import java.time.Duration; import java.util.ArrayList; @@ -15,7 +14,6 @@ import java.util.List; * * @author Lion Li */ -@Component public class PlusSaTokenDao implements SaTokenDao { /** diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/satoken/service/SaPermissionImpl.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/satoken/service/SaPermissionImpl.java index 057d18336..632cc7168 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/satoken/service/SaPermissionImpl.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/satoken/service/SaPermissionImpl.java @@ -4,7 +4,6 @@ import cn.dev33.satoken.stp.StpInterface; import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.enums.UserType; import com.ruoyi.common.helper.LoginHelper; -import org.springframework.stereotype.Component; import java.util.ArrayList; import java.util.List; @@ -14,7 +13,6 @@ import java.util.List; * * @author Lion Li */ -@Component public class SaPermissionImpl implements StpInterface { /** From 6f209cad990bab9363a279d7bc6d908ceb8ba5f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Wed, 15 Feb 2023 13:01:05 +0800 Subject: [PATCH 18/34] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E5=90=AF?= =?UTF-8?q?=E7=94=A8=20sqlserver=20=E9=AB=98=E7=89=88=E6=9C=AC=E8=AF=AD?= =?UTF-8?q?=E6=B3=95=20=E7=AE=80=E5=8C=96sql=E8=84=9A=E6=9C=AC=E8=AF=AD?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/sql/sqlserver/sqlserver_ry_vue_4.X.sql | 1004 ++++++++--------- script/sql/sqlserver/sqlserver_test.sql | 310 ++--- 2 files changed, 651 insertions(+), 663 deletions(-) diff --git a/script/sql/sqlserver/sqlserver_ry_vue_4.X.sql b/script/sql/sqlserver/sqlserver_ry_vue_4.X.sql index 195796ca6..e992c567d 100644 --- a/script/sql/sqlserver/sqlserver_ry_vue_4.X.sql +++ b/script/sql/sqlserver/sqlserver_ry_vue_4.X.sql @@ -1,27 +1,27 @@ -CREATE TABLE [gen_table] +CREATE TABLE gen_table ( - [table_id] bigint NOT NULL, - [table_name] nvarchar(200) DEFAULT '' NULL, - [table_comment] nvarchar(500) DEFAULT '' NULL, - [sub_table_name] nvarchar(64) NULL, - [sub_table_fk_name] nvarchar(64) NULL, - [class_name] nvarchar(100) DEFAULT '' NULL, - [tpl_category] nvarchar(200) DEFAULT ('crud') NULL, - [package_name] nvarchar(100) NULL, - [module_name] nvarchar(30) NULL, - [business_name] nvarchar(30) NULL, - [function_name] nvarchar(50) NULL, - [function_author] nvarchar(50) NULL, - [gen_type] nchar(1) DEFAULT ('0') NULL, - [gen_path] nvarchar(200) DEFAULT ('/') NULL, - [options] nvarchar(1000) NULL, - [create_by] nvarchar(64) DEFAULT '' NULL, - [create_time] datetime2(7) NULL, - [update_by] nvarchar(64) DEFAULT '' NULL, - [update_time] datetime2(7) NULL, - [remark] nvarchar(500) NULL, - CONSTRAINT [PK__gen_tabl__B21E8F2427725F8A] PRIMARY KEY CLUSTERED ([table_id]) + table_id bigint NOT NULL, + table_name nvarchar(200) DEFAULT '' NULL, + table_comment nvarchar(500) DEFAULT '' NULL, + sub_table_name nvarchar(64) NULL, + sub_table_fk_name nvarchar(64) NULL, + class_name nvarchar(100) DEFAULT '' NULL, + tpl_category nvarchar(200) DEFAULT ('crud') NULL, + package_name nvarchar(100) NULL, + module_name nvarchar(30) NULL, + business_name nvarchar(30) NULL, + function_name nvarchar(50) NULL, + function_author nvarchar(50) NULL, + gen_type nchar(1) DEFAULT ('0') NULL, + gen_path nvarchar(200) DEFAULT ('/') NULL, + options nvarchar(1000) NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + remark nvarchar(500) NULL, + CONSTRAINT PK__gen_tabl__B21E8F2427725F8A PRIMARY KEY CLUSTERED (table_id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -154,31 +154,31 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'gen_table' GO -CREATE TABLE [gen_table_column] +CREATE TABLE gen_table_column ( - [column_id] bigint NOT NULL, - [table_id] bigint NULL, - [column_name] nvarchar(200) NULL, - [column_comment] nvarchar(500) NULL, - [column_type] nvarchar(100) NULL, - [java_type] nvarchar(500) NULL, - [java_field] nvarchar(200) NULL, - [is_pk] nchar(1) NULL, - [is_increment] nchar(1) NULL, - [is_required] nchar(1) NULL, - [is_insert] nchar(1) NULL, - [is_edit] nchar(1) NULL, - [is_list] nchar(1) NULL, - [is_query] nchar(1) NULL, - [query_type] nvarchar(200) DEFAULT ('EQ') NULL, - [html_type] nvarchar(200) NULL, - [dict_type] nvarchar(200) DEFAULT '' NULL, - [sort] int NULL, - [create_by] nvarchar(64) DEFAULT '' NULL, - [create_time] datetime2(7) NULL, - [update_by] nvarchar(64) DEFAULT '' NULL, - [update_time] datetime2(7) NULL, - CONSTRAINT [PK__gen_tabl__E301851F2E68B4E8] PRIMARY KEY CLUSTERED ([column_id]) + column_id bigint NOT NULL, + table_id bigint NULL, + column_name nvarchar(200) NULL, + column_comment nvarchar(500) NULL, + column_type nvarchar(100) NULL, + java_type nvarchar(500) NULL, + java_field nvarchar(200) NULL, + is_pk nchar(1) NULL, + is_increment nchar(1) NULL, + is_required nchar(1) NULL, + is_insert nchar(1) NULL, + is_edit nchar(1) NULL, + is_list nchar(1) NULL, + is_query nchar(1) NULL, + query_type nvarchar(200) DEFAULT ('EQ') NULL, + html_type nvarchar(200) NULL, + dict_type nvarchar(200) DEFAULT '' NULL, + sort int NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + CONSTRAINT PK__gen_tabl__E301851F2E68B4E8 PRIMARY KEY CLUSTERED (column_id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -323,19 +323,19 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'gen_table_column' GO -CREATE TABLE [sys_config] +CREATE TABLE sys_config ( - [config_id] bigint NOT NULL, - [config_name] nvarchar(100) DEFAULT '' NULL, - [config_key] nvarchar(100) DEFAULT '' NULL, - [config_value] nvarchar(500) DEFAULT '' NULL, - [config_type] nchar(1) DEFAULT ('N') NULL, - [create_by] nvarchar(64) DEFAULT '' NULL, - [create_time] datetime2(7) NULL, - [update_by] nvarchar(64) DEFAULT '' NULL, - [update_time] datetime2(7) NULL, - [remark] nvarchar(500) NULL, - CONSTRAINT [PK__sys_conf__4AD1BFF182643682] PRIMARY KEY CLUSTERED ([config_id]) + config_id bigint NOT NULL, + config_name nvarchar(100) DEFAULT '' NULL, + config_key nvarchar(100) DEFAULT '' NULL, + config_value nvarchar(500) DEFAULT '' NULL, + config_type nchar(1) DEFAULT ('N') NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + remark nvarchar(500) NULL, + CONSTRAINT PK__sys_conf__4AD1BFF182643682 PRIMARY KEY CLUSTERED (config_id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -408,36 +408,36 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_config' GO -INSERT [sys_config] ([config_id], [config_name], [config_key], [config_value], [config_type], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1, N'主框架页-默认皮肤样式名称', N'sys.index.skinName', N'skin-blue', N'Y', N'admin', getdate(), N'', NULL, N'蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow') +INSERT sys_config VALUES (1, N'主框架页-默认皮肤样式名称', N'sys.index.skinName', N'skin-blue', N'Y', N'admin', getdate(), N'', NULL, N'蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow') GO -INSERT [sys_config] ([config_id], [config_name], [config_key], [config_value], [config_type], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (2, N'用户管理-账号初始密码', N'sys.user.initPassword', N'123456', N'Y', N'admin', getdate(), N'', NULL, N'初始化密码 123456') +INSERT sys_config VALUES (2, N'用户管理-账号初始密码', N'sys.user.initPassword', N'123456', N'Y', N'admin', getdate(), N'', NULL, N'初始化密码 123456') GO -INSERT [sys_config] ([config_id], [config_name], [config_key], [config_value], [config_type], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (3, N'主框架页-侧边栏主题', N'sys.index.sideTheme', N'theme-dark', N'Y', N'admin', getdate(), N'', NULL, N'深色主题theme-dark,浅色主题theme-light') +INSERT sys_config VALUES (3, N'主框架页-侧边栏主题', N'sys.index.sideTheme', N'theme-dark', N'Y', N'admin', getdate(), N'', NULL, N'深色主题theme-dark,浅色主题theme-light') GO -INSERT [sys_config] ([config_id], [config_name], [config_key], [config_value], [config_type], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (4, N'账号自助-验证码开关', N'sys.account.captchaEnabled', N'true', N'Y', N'admin', getdate(), N'', NULL, N'是否开启验证码功能(true开启,false关闭)') +INSERT sys_config VALUES (4, N'账号自助-验证码开关', N'sys.account.captchaEnabled', N'true', N'Y', N'admin', getdate(), N'', NULL, N'是否开启验证码功能(true开启,false关闭)') GO -INSERT [sys_config] ([config_id], [config_name], [config_key], [config_value], [config_type], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (5, N'账号自助-是否开启用户注册功能', N'sys.account.registerUser', N'false', N'Y', N'admin', getdate(), N'', NULL, N'是否开启注册用户功能(true开启,false关闭)') +INSERT sys_config VALUES (5, N'账号自助-是否开启用户注册功能', N'sys.account.registerUser', N'false', N'Y', N'admin', getdate(), N'', NULL, N'是否开启注册用户功能(true开启,false关闭)') GO -INSERT [sys_config] ([config_id], [config_name], [config_key], [config_value], [config_type], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (11, N'OSS预览列表资源开关', N'sys.oss.previewListResource', N'true', N'Y', N'admin', getdate(), N'', null, N'true:开启, false:关闭'); +INSERT sys_config VALUES (11, N'OSS预览列表资源开关', N'sys.oss.previewListResource', N'true', N'Y', N'admin', getdate(), N'', null, N'true:开启, false:关闭'); GO -CREATE TABLE [sys_dept] +CREATE TABLE sys_dept ( - [dept_id] bigint NOT NULL, - [parent_id] bigint DEFAULT ((0)) NULL, - [ancestors] nvarchar(500)DEFAULT '' NULL, - [dept_name] nvarchar(30) DEFAULT '' NULL, - [order_num] int DEFAULT ((0)) NULL, - [leader] nvarchar(20) NULL, - [phone] nvarchar(11) NULL, - [email] nvarchar(50) NULL, - [status] nchar(1) DEFAULT ('0') NULL, - [del_flag] nchar(1) DEFAULT ('0') NULL, - [create_by] nvarchar(64) DEFAULT '' NULL, - [create_time] datetime2(7) NULL, - [update_by] nvarchar(64) DEFAULT '' NULL, - [update_time] datetime2(7) NULL, - CONSTRAINT [PK__sys_dept__DCA659747DE13804] PRIMARY KEY CLUSTERED ([dept_id]) + dept_id bigint NOT NULL, + parent_id bigint DEFAULT ((0)) NULL, + ancestors nvarchar(500)DEFAULT '' NULL, + dept_name nvarchar(30) DEFAULT '' NULL, + order_num int DEFAULT ((0)) NULL, + leader nvarchar(20) NULL, + phone nvarchar(11) NULL, + email nvarchar(50) NULL, + status nchar(1) DEFAULT ('0') NULL, + del_flag nchar(1) DEFAULT ('0') NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + CONSTRAINT PK__sys_dept__DCA659747DE13804 PRIMARY KEY CLUSTERED (dept_id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -534,44 +534,44 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_dept' GO -INSERT [sys_dept] ([dept_id], [parent_id], [ancestors], [dept_name], [order_num], [leader], [phone], [email], [status], [del_flag], [create_by], [create_time], [update_by], [update_time]) VALUES (100, 0, N'0', N'若依科技', 0, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) +INSERT sys_dept VALUES (100, 0, N'0', N'若依科技', 0, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) GO -INSERT [sys_dept] ([dept_id], [parent_id], [ancestors], [dept_name], [order_num], [leader], [phone], [email], [status], [del_flag], [create_by], [create_time], [update_by], [update_time]) VALUES (101, 100, N'0,100', N'深圳总公司', 1, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) +INSERT sys_dept VALUES (101, 100, N'0,100', N'深圳总公司', 1, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) GO -INSERT [sys_dept] ([dept_id], [parent_id], [ancestors], [dept_name], [order_num], [leader], [phone], [email], [status], [del_flag], [create_by], [create_time], [update_by], [update_time]) VALUES (102, 100, N'0,100', N'长沙分公司', 2, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) +INSERT sys_dept VALUES (102, 100, N'0,100', N'长沙分公司', 2, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) GO -INSERT [sys_dept] ([dept_id], [parent_id], [ancestors], [dept_name], [order_num], [leader], [phone], [email], [status], [del_flag], [create_by], [create_time], [update_by], [update_time]) VALUES (103, 101, N'0,100,101', N'研发部门', 1, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) +INSERT sys_dept VALUES (103, 101, N'0,100,101', N'研发部门', 1, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) GO -INSERT [sys_dept] ([dept_id], [parent_id], [ancestors], [dept_name], [order_num], [leader], [phone], [email], [status], [del_flag], [create_by], [create_time], [update_by], [update_time]) VALUES (104, 101, N'0,100,101', N'市场部门', 2, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) +INSERT sys_dept VALUES (104, 101, N'0,100,101', N'市场部门', 2, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) GO -INSERT [sys_dept] ([dept_id], [parent_id], [ancestors], [dept_name], [order_num], [leader], [phone], [email], [status], [del_flag], [create_by], [create_time], [update_by], [update_time]) VALUES (105, 101, N'0,100,101', N'测试部门', 3, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) +INSERT sys_dept VALUES (105, 101, N'0,100,101', N'测试部门', 3, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) GO -INSERT [sys_dept] ([dept_id], [parent_id], [ancestors], [dept_name], [order_num], [leader], [phone], [email], [status], [del_flag], [create_by], [create_time], [update_by], [update_time]) VALUES (106, 101, N'0,100,101', N'财务部门', 4, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) +INSERT sys_dept VALUES (106, 101, N'0,100,101', N'财务部门', 4, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) GO -INSERT [sys_dept] ([dept_id], [parent_id], [ancestors], [dept_name], [order_num], [leader], [phone], [email], [status], [del_flag], [create_by], [create_time], [update_by], [update_time]) VALUES (107, 101, N'0,100,101', N'运维部门', 5, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) +INSERT sys_dept VALUES (107, 101, N'0,100,101', N'运维部门', 5, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) GO -INSERT [sys_dept] ([dept_id], [parent_id], [ancestors], [dept_name], [order_num], [leader], [phone], [email], [status], [del_flag], [create_by], [create_time], [update_by], [update_time]) VALUES (108, 102, N'0,100,102', N'市场部门', 1, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) +INSERT sys_dept VALUES (108, 102, N'0,100,102', N'市场部门', 1, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) GO -INSERT [sys_dept] ([dept_id], [parent_id], [ancestors], [dept_name], [order_num], [leader], [phone], [email], [status], [del_flag], [create_by], [create_time], [update_by], [update_time]) VALUES (109, 102, N'0,100,102', N'财务部门', 2, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) +INSERT sys_dept VALUES (109, 102, N'0,100,102', N'财务部门', 2, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) GO -CREATE TABLE [sys_dict_data] +CREATE TABLE sys_dict_data ( - [dict_code] bigint NOT NULL, - [dict_sort] int DEFAULT ((0)) NULL, - [dict_label] nvarchar(100) DEFAULT '' NULL, - [dict_value] nvarchar(100) DEFAULT '' NULL, - [dict_type] nvarchar(100) DEFAULT '' NULL, - [css_class] nvarchar(100) NULL, - [list_class] nvarchar(100) NULL, - [is_default] nchar(1) DEFAULT ('N') NULL, - [status] nchar(1) DEFAULT ('0') NULL, - [create_by] nvarchar(64) DEFAULT '' NULL, - [create_time] datetime2(7) NULL, - [update_by] nvarchar(64) DEFAULT '' NULL, - [update_time] datetime2(7) NULL, - [remark] nvarchar(500) NULL, - CONSTRAINT [PK__sys_dict__19CBC34B661AF3B3] PRIMARY KEY CLUSTERED ([dict_code]) + dict_code bigint NOT NULL, + dict_sort int DEFAULT ((0)) NULL, + dict_label nvarchar(100) DEFAULT '' NULL, + dict_value nvarchar(100) DEFAULT '' NULL, + dict_type nvarchar(100) DEFAULT '' NULL, + css_class nvarchar(100) NULL, + list_class nvarchar(100) NULL, + is_default nchar(1) DEFAULT ('N') NULL, + status nchar(1) DEFAULT ('0') NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + remark nvarchar(500) NULL, + CONSTRAINT PK__sys_dict__19CBC34B661AF3B3 PRIMARY KEY CLUSTERED (dict_code) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -668,77 +668,69 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_dict_data' GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1, 1, N'男', N'0', N'sys_user_sex', N'', N'', N'Y', N'0', N'admin', getdate(), N'', NULL, N'性别男') +INSERT sys_dict_data VALUES (1, 1, N'男', N'0', N'sys_user_sex', N'', N'', N'Y', N'0', N'admin', getdate(), N'', NULL, N'性别男') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (2, 2, N'女', N'1', N'sys_user_sex', N'', N'', N'N', N'0', N'admin', getdate(), N'', NULL, N'性别女') +INSERT sys_dict_data VALUES (2, 2, N'女', N'1', N'sys_user_sex', N'', N'', N'N', N'0', N'admin', getdate(), N'', NULL, N'性别女') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (3, 3, N'未知', N'2', N'sys_user_sex', N'', N'', N'N', N'0', N'admin', getdate(), N'', NULL, N'性别未知') +INSERT sys_dict_data VALUES (3, 3, N'未知', N'2', N'sys_user_sex', N'', N'', N'N', N'0', N'admin', getdate(), N'', NULL, N'性别未知') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (4, 1, N'显示', N'0', N'sys_show_hide', N'', N'primary', N'Y', N'0', N'admin', getdate(), N'', NULL, N'显示菜单') +INSERT sys_dict_data VALUES (4, 1, N'显示', N'0', N'sys_show_hide', N'', N'primary', N'Y', N'0', N'admin', getdate(), N'', NULL, N'显示菜单') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (5, 2, N'隐藏', N'1', N'sys_show_hide', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'隐藏菜单') +INSERT sys_dict_data VALUES (5, 2, N'隐藏', N'1', N'sys_show_hide', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'隐藏菜单') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (6, 1, N'正常', N'0', N'sys_normal_disable', N'', N'primary', N'Y', N'0', N'admin', getdate(), N'', NULL, N'正常状态') +INSERT sys_dict_data VALUES (6, 1, N'正常', N'0', N'sys_normal_disable', N'', N'primary', N'Y', N'0', N'admin', getdate(), N'', NULL, N'正常状态') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (7, 2, N'停用', N'1', N'sys_normal_disable', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'停用状态') +INSERT sys_dict_data VALUES (7, 2, N'停用', N'1', N'sys_normal_disable', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'停用状态') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (8, 1, N'正常', N'0', N'sys_job_status', N'', N'primary', N'Y', N'0', N'admin', getdate(), N'', NULL, N'正常状态') +INSERT sys_dict_data VALUES (12, 1, N'是', N'Y', N'sys_yes_no', N'', N'primary', N'Y', N'0', N'admin', getdate(), N'', NULL, N'系统默认是') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (9, 2, N'暂停', N'1', N'sys_job_status', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'停用状态') +INSERT sys_dict_data VALUES (13, 2, N'否', N'N', N'sys_yes_no', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'系统默认否') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (10, 1, N'默认', N'DEFAULT', N'sys_job_group', N'', N'', N'Y', N'0', N'admin', getdate(), N'', NULL, N'默认分组') +INSERT sys_dict_data VALUES (14, 1, N'通知', N'1', N'sys_notice_type', N'', N'warning', N'Y', N'0', N'admin', getdate(), N'', NULL, N'通知') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (11, 2, N'系统', N'SYSTEM', N'sys_job_group', N'', N'', N'N', N'0', N'admin', getdate(), N'', NULL, N'系统分组') +INSERT sys_dict_data VALUES (15, 2, N'公告', N'2', N'sys_notice_type', N'', N'success', N'N', N'0', N'admin', getdate(), N'', NULL, N'公告') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (12, 1, N'是', N'Y', N'sys_yes_no', N'', N'primary', N'Y', N'0', N'admin', getdate(), N'', NULL, N'系统默认是') +INSERT sys_dict_data VALUES (16, 1, N'正常', N'0', N'sys_notice_status', N'', N'primary', N'Y', N'0', N'admin', getdate(), N'', NULL, N'正常状态') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (13, 2, N'否', N'N', N'sys_yes_no', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'系统默认否') +INSERT sys_dict_data VALUES (17, 2, N'关闭', N'1', N'sys_notice_status', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'关闭状态') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (14, 1, N'通知', N'1', N'sys_notice_type', N'', N'warning', N'Y', N'0', N'admin', getdate(), N'', NULL, N'通知') +INSERT sys_dict_data VALUES (29, 99, N'其他', N'0', N'sys_oper_type', N'', N'info', N'N', N'0', N'admin', getdate(), N'', NULL, N'其他操作'); GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (15, 2, N'公告', N'2', N'sys_notice_type', N'', N'success', N'N', N'0', N'admin', getdate(), N'', NULL, N'公告') +INSERT sys_dict_data VALUES (18, 1, N'新增', N'1', N'sys_oper_type', N'', N'info', N'N', N'0', N'admin', getdate(), N'', NULL, N'新增操作') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (16, 1, N'正常', N'0', N'sys_notice_status', N'', N'primary', N'Y', N'0', N'admin', getdate(), N'', NULL, N'正常状态') +INSERT sys_dict_data VALUES (19, 2, N'修改', N'2', N'sys_oper_type', N'', N'info', N'N', N'0', N'admin', getdate(), N'', NULL, N'修改操作') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (17, 2, N'关闭', N'1', N'sys_notice_status', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'关闭状态') +INSERT sys_dict_data VALUES (20, 3, N'删除', N'3', N'sys_oper_type', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'删除操作') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (29, 99, N'其他', N'0', N'sys_oper_type', N'', N'info', N'N', N'0', N'admin', getdate(), N'', NULL, N'其他操作'); +INSERT sys_dict_data VALUES (21, 4, N'授权', N'4', N'sys_oper_type', N'', N'primary', N'N', N'0', N'admin', getdate(), N'', NULL, N'授权操作') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (18, 1, N'新增', N'1', N'sys_oper_type', N'', N'info', N'N', N'0', N'admin', getdate(), N'', NULL, N'新增操作') +INSERT sys_dict_data VALUES (22, 5, N'导出', N'5', N'sys_oper_type', N'', N'warning', N'N', N'0', N'admin', getdate(), N'', NULL, N'导出操作') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (19, 2, N'修改', N'2', N'sys_oper_type', N'', N'info', N'N', N'0', N'admin', getdate(), N'', NULL, N'修改操作') +INSERT sys_dict_data VALUES (23, 6, N'导入', N'6', N'sys_oper_type', N'', N'warning', N'N', N'0', N'admin', getdate(), N'', NULL, N'导入操作') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (20, 3, N'删除', N'3', N'sys_oper_type', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'删除操作') +INSERT sys_dict_data VALUES (24, 7, N'强退', N'7', N'sys_oper_type', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'强退操作') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (21, 4, N'授权', N'4', N'sys_oper_type', N'', N'primary', N'N', N'0', N'admin', getdate(), N'', NULL, N'授权操作') +INSERT sys_dict_data VALUES (25, 8, N'生成代码', N'8', N'sys_oper_type', N'', N'warning', N'N', N'0', N'admin', getdate(), N'', NULL, N'生成操作') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (22, 5, N'导出', N'5', N'sys_oper_type', N'', N'warning', N'N', N'0', N'admin', getdate(), N'', NULL, N'导出操作') +INSERT sys_dict_data VALUES (26, 9, N'清空数据', N'9', N'sys_oper_type', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'清空操作') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (23, 6, N'导入', N'6', N'sys_oper_type', N'', N'warning', N'N', N'0', N'admin', getdate(), N'', NULL, N'导入操作') +INSERT sys_dict_data VALUES (27, 1, N'成功', N'0', N'sys_common_status', N'', N'primary', N'N', N'0', N'admin', getdate(), N'', NULL, N'正常状态') GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (24, 7, N'强退', N'7', N'sys_oper_type', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'强退操作') -GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (25, 8, N'生成代码', N'8', N'sys_oper_type', N'', N'warning', N'N', N'0', N'admin', getdate(), N'', NULL, N'生成操作') -GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (26, 9, N'清空数据', N'9', N'sys_oper_type', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'清空操作') -GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (27, 1, N'成功', N'0', N'sys_common_status', N'', N'primary', N'N', N'0', N'admin', getdate(), N'', NULL, N'正常状态') -GO -INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (28, 2, N'失败', N'1', N'sys_common_status', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'停用状态') +INSERT sys_dict_data VALUES (28, 2, N'失败', N'1', N'sys_common_status', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'停用状态') GO -CREATE TABLE [sys_dict_type] +CREATE TABLE sys_dict_type ( - [dict_id] bigint NOT NULL, - [dict_name] nvarchar(100) DEFAULT '' NULL, - [dict_type] nvarchar(100) DEFAULT '' NULL, - [status] nchar(1) DEFAULT ('0') NULL, - [create_by] nvarchar(64) DEFAULT '' NULL, - [create_time] datetime2(7) NULL, - [update_by] nvarchar(64) DEFAULT '' NULL, - [update_time] datetime2(7) NULL, - [remark] nvarchar(500) NULL, - CONSTRAINT [PK__sys_dict__3BD4186C409C5391] PRIMARY KEY CLUSTERED ([dict_id]) + dict_id bigint NOT NULL, + dict_name nvarchar(100) DEFAULT '' NULL, + dict_type nvarchar(100) DEFAULT '' NULL, + status nchar(1) DEFAULT ('0') NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + remark nvarchar(500) NULL, + CONSTRAINT PK__sys_dict__3BD4186C409C5391 PRIMARY KEY CLUSTERED (dict_id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -805,39 +797,35 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_dict_type' GO -INSERT [sys_dict_type] ([dict_id], [dict_name], [dict_type], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1, N'用户性别', N'sys_user_sex', N'0', N'admin', getdate(), N'', NULL, N'用户性别列表') +INSERT sys_dict_type VALUES (1, N'用户性别', N'sys_user_sex', N'0', N'admin', getdate(), N'', NULL, N'用户性别列表') GO -INSERT [sys_dict_type] ([dict_id], [dict_name], [dict_type], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (2, N'菜单状态', N'sys_show_hide', N'0', N'admin', getdate(), N'', NULL, N'菜单状态列表') +INSERT sys_dict_type VALUES (2, N'菜单状态', N'sys_show_hide', N'0', N'admin', getdate(), N'', NULL, N'菜单状态列表') GO -INSERT [sys_dict_type] ([dict_id], [dict_name], [dict_type], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (3, N'系统开关', N'sys_normal_disable', N'0', N'admin', getdate(), N'', NULL, N'系统开关列表') +INSERT sys_dict_type VALUES (3, N'系统开关', N'sys_normal_disable', N'0', N'admin', getdate(), N'', NULL, N'系统开关列表') GO -INSERT [sys_dict_type] ([dict_id], [dict_name], [dict_type], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (4, N'任务状态', N'sys_job_status', N'0', N'admin', getdate(), N'', NULL, N'任务状态列表') +INSERT sys_dict_type VALUES (6, N'系统是否', N'sys_yes_no', N'0', N'admin', getdate(), N'', NULL, N'系统是否列表') GO -INSERT [sys_dict_type] ([dict_id], [dict_name], [dict_type], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (5, N'任务分组', N'sys_job_group', N'0', N'admin', getdate(), N'', NULL, N'任务分组列表') +INSERT sys_dict_type VALUES (7, N'通知类型', N'sys_notice_type', N'0', N'admin', getdate(), N'', NULL, N'通知类型列表') GO -INSERT [sys_dict_type] ([dict_id], [dict_name], [dict_type], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (6, N'系统是否', N'sys_yes_no', N'0', N'admin', getdate(), N'', NULL, N'系统是否列表') +INSERT sys_dict_type VALUES (8, N'通知状态', N'sys_notice_status', N'0', N'admin', getdate(), N'', NULL, N'通知状态列表') GO -INSERT [sys_dict_type] ([dict_id], [dict_name], [dict_type], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (7, N'通知类型', N'sys_notice_type', N'0', N'admin', getdate(), N'', NULL, N'通知类型列表') +INSERT sys_dict_type VALUES (9, N'操作类型', N'sys_oper_type', N'0', N'admin', getdate(), N'', NULL, N'操作类型列表') GO -INSERT [sys_dict_type] ([dict_id], [dict_name], [dict_type], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (8, N'通知状态', N'sys_notice_status', N'0', N'admin', getdate(), N'', NULL, N'通知状态列表') -GO -INSERT [sys_dict_type] ([dict_id], [dict_name], [dict_type], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (9, N'操作类型', N'sys_oper_type', N'0', N'admin', getdate(), N'', NULL, N'操作类型列表') -GO -INSERT [sys_dict_type] ([dict_id], [dict_name], [dict_type], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (10, N'系统状态', N'sys_common_status', N'0', N'admin', getdate(), N'', NULL, N'登录状态列表') +INSERT sys_dict_type VALUES (10, N'系统状态', N'sys_common_status', N'0', N'admin', getdate(), N'', NULL, N'登录状态列表') GO -CREATE TABLE [sys_logininfor] +CREATE TABLE sys_logininfor ( - [info_id] bigint NOT NULL, - [user_name] nvarchar(50) DEFAULT '' NULL, - [ipaddr] nvarchar(128) DEFAULT '' NULL, - [login_location] nvarchar(255) DEFAULT '' NULL, - [browser] nvarchar(50) DEFAULT '' NULL, - [os] nvarchar(50) DEFAULT '' NULL, - [status] nchar(1) DEFAULT ('0') NULL, - [msg] nvarchar(255) DEFAULT '' NULL, - [login_time] datetime2(7) NULL, - CONSTRAINT [PK__sys_logi__3D8A9C1A1854AE10] PRIMARY KEY CLUSTERED ([info_id]) + info_id bigint NOT NULL, + user_name nvarchar(50) DEFAULT '' NULL, + ipaddr nvarchar(128) DEFAULT '' NULL, + login_location nvarchar(255) DEFAULT '' NULL, + browser nvarchar(50) DEFAULT '' NULL, + os nvarchar(50) DEFAULT '' NULL, + status nchar(1) DEFAULT ('0') NULL, + msg nvarchar(255) DEFAULT '' NULL, + login_time datetime2(7) NULL, + CONSTRAINT PK__sys_logi__3D8A9C1A1854AE10 PRIMARY KEY CLUSTERED (info_id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -904,28 +892,28 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_logininfor' GO -CREATE TABLE [sys_menu] +CREATE TABLE sys_menu ( - [menu_id] bigint NOT NULL, - [menu_name] nvarchar(50) NOT NULL, - [parent_id] bigint DEFAULT ((0)) NULL, - [order_num] int DEFAULT ((0)) NULL, - [path] nvarchar(200) DEFAULT '' NULL, - [component] nvarchar(255) NULL, - [query_param] nvarchar(255) NULL, - [is_frame] int DEFAULT ((1)) NULL, - [is_cache] int DEFAULT ((0)) NULL, - [menu_type] nchar(1) DEFAULT '' NULL, - [visible] nchar(1) DEFAULT ((0)) NULL, - [status] nchar(1) DEFAULT ((0)) NULL, - [perms] nvarchar(100) NULL, - [icon] nvarchar(100) DEFAULT ('#') NULL, - [create_by] nvarchar(64) DEFAULT '' NULL, - [create_time] datetime2(7) NULL, - [update_by] nvarchar(64) DEFAULT '' NULL, - [update_time] datetime2(7) NULL, - [remark] nvarchar(500) DEFAULT '' NULL, - CONSTRAINT [PK__sys_menu__4CA0FADCF8545C58] PRIMARY KEY CLUSTERED ([menu_id]) + menu_id bigint NOT NULL, + menu_name nvarchar(50) NOT NULL, + parent_id bigint DEFAULT ((0)) NULL, + order_num int DEFAULT ((0)) NULL, + path nvarchar(200) DEFAULT '' NULL, + component nvarchar(255) NULL, + query_param nvarchar(255) NULL, + is_frame int DEFAULT ((1)) NULL, + is_cache int DEFAULT ((0)) NULL, + menu_type nchar(1) DEFAULT '' NULL, + visible nchar(1) DEFAULT ((0)) NULL, + status nchar(1) DEFAULT ((0)) NULL, + perms nvarchar(100) NULL, + icon nvarchar(100) DEFAULT ('#') NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + remark nvarchar(500) DEFAULT '' NULL, + CONSTRAINT PK__sys_menu__4CA0FADCF8545C58 PRIMARY KEY CLUSTERED (menu_id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -1052,187 +1040,187 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_menu' GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1, N'系统管理', 0, 1, N'system', NULL, N'', 1, 0, N'M', N'0', N'0', N'', N'system', N'admin', getdate(), N'', NULL, N'系统管理目录') +INSERT sys_menu VALUES (1, N'系统管理', 0, 1, N'system', NULL, N'', 1, 0, N'M', N'0', N'0', N'', N'system', N'admin', getdate(), N'', NULL, N'系统管理目录') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (2, N'系统监控', 0, 2, N'monitor', NULL, N'', 1, 0, N'M', N'0', N'0', N'', N'monitor', N'admin', getdate(), N'', NULL, N'系统监控目录') +INSERT sys_menu VALUES (2, N'系统监控', 0, 2, N'monitor', NULL, N'', 1, 0, N'M', N'0', N'0', N'', N'monitor', N'admin', getdate(), N'', NULL, N'系统监控目录') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (3, N'系统工具', 0, 3, N'tool', NULL, N'', 1, 0, N'M', N'0', N'0', N'', N'tool', N'admin', getdate(), N'', NULL, N'系统工具目录') +INSERT sys_menu VALUES (3, N'系统工具', 0, 3, N'tool', NULL, N'', 1, 0, N'M', N'0', N'0', N'', N'tool', N'admin', getdate(), N'', NULL, N'系统工具目录') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (100, N'用户管理', 1, 1, N'user', N'system/user/index', N'', 1, 0, N'C', N'0', N'0', N'system:user:list', N'user', N'admin', getdate(), N'', NULL, N'用户管理菜单') +INSERT sys_menu VALUES (100, N'用户管理', 1, 1, N'user', N'system/user/index', N'', 1, 0, N'C', N'0', N'0', N'system:user:list', N'user', N'admin', getdate(), N'', NULL, N'用户管理菜单') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (101, N'角色管理', 1, 2, N'role', N'system/role/index', N'', 1, 0, N'C', N'0', N'0', N'system:role:list', N'peoples', N'admin', getdate(), N'', NULL, N'角色管理菜单') +INSERT sys_menu VALUES (101, N'角色管理', 1, 2, N'role', N'system/role/index', N'', 1, 0, N'C', N'0', N'0', N'system:role:list', N'peoples', N'admin', getdate(), N'', NULL, N'角色管理菜单') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (102, N'菜单管理', 1, 3, N'menu', N'system/menu/index', N'', 1, 0, N'C', N'0', N'0', N'system:menu:list', N'tree-table', N'admin', getdate(), N'', NULL, N'菜单管理菜单') +INSERT sys_menu VALUES (102, N'菜单管理', 1, 3, N'menu', N'system/menu/index', N'', 1, 0, N'C', N'0', N'0', N'system:menu:list', N'tree-table', N'admin', getdate(), N'', NULL, N'菜单管理菜单') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (103, N'部门管理', 1, 4, N'dept', N'system/dept/index', N'', 1, 0, N'C', N'0', N'0', N'system:dept:list', N'tree', N'admin', getdate(), N'', NULL, N'部门管理菜单') +INSERT sys_menu VALUES (103, N'部门管理', 1, 4, N'dept', N'system/dept/index', N'', 1, 0, N'C', N'0', N'0', N'system:dept:list', N'tree', N'admin', getdate(), N'', NULL, N'部门管理菜单') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (104, N'岗位管理', 1, 5, N'post', N'system/post/index', N'', 1, 0, N'C', N'0', N'0', N'system:post:list', N'post', N'admin', getdate(), N'', NULL, N'岗位管理菜单') +INSERT sys_menu VALUES (104, N'岗位管理', 1, 5, N'post', N'system/post/index', N'', 1, 0, N'C', N'0', N'0', N'system:post:list', N'post', N'admin', getdate(), N'', NULL, N'岗位管理菜单') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (105, N'字典管理', 1, 6, N'dict', N'system/dict/index', N'', 1, 0, N'C', N'0', N'0', N'system:dict:list', N'dict', N'admin', getdate(), N'', NULL, N'字典管理菜单') +INSERT sys_menu VALUES (105, N'字典管理', 1, 6, N'dict', N'system/dict/index', N'', 1, 0, N'C', N'0', N'0', N'system:dict:list', N'dict', N'admin', getdate(), N'', NULL, N'字典管理菜单') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (106, N'参数设置', 1, 7, N'config', N'system/config/index', N'', 1, 0, N'C', N'0', N'0', N'system:config:list', N'edit', N'admin', getdate(), N'', NULL, N'参数设置菜单') +INSERT sys_menu VALUES (106, N'参数设置', 1, 7, N'config', N'system/config/index', N'', 1, 0, N'C', N'0', N'0', N'system:config:list', N'edit', N'admin', getdate(), N'', NULL, N'参数设置菜单') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (107, N'通知公告', 1, 8, N'notice', N'system/notice/index', N'', 1, 0, N'C', N'0', N'0', N'system:notice:list', N'message', N'admin', getdate(), N'', NULL, N'通知公告菜单') +INSERT sys_menu VALUES (107, N'通知公告', 1, 8, N'notice', N'system/notice/index', N'', 1, 0, N'C', N'0', N'0', N'system:notice:list', N'message', N'admin', getdate(), N'', NULL, N'通知公告菜单') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (108, N'日志管理', 1, 9, N'log', N'', N'', 1, 0, N'M', N'0', N'0', N'', N'log', N'admin', getdate(), N'', NULL, N'日志管理菜单') +INSERT sys_menu VALUES (108, N'日志管理', 1, 9, N'log', N'', N'', 1, 0, N'M', N'0', N'0', N'', N'log', N'admin', getdate(), N'', NULL, N'日志管理菜单') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (109, N'在线用户', 2, 1, N'online', N'monitor/online/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:online:list', N'online', N'admin', getdate(), N'', NULL, N'在线用户菜单') +INSERT sys_menu VALUES (109, N'在线用户', 2, 1, N'online', N'monitor/online/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:online:list', N'online', N'admin', getdate(), N'', NULL, N'在线用户菜单') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (112, N'缓存列表', 2, 6, N'cacheList', N'monitor/cache/list', N'', 1, 0, N'C', N'0', N'0', N'monitor:cache:list', N'redis-list', N'admin', getdate(), N'', NULL, N'缓存列表菜单') +INSERT sys_menu VALUES (112, N'缓存列表', 2, 6, N'cacheList', N'monitor/cache/list', N'', 1, 0, N'C', N'0', N'0', N'monitor:cache:list', N'redis-list', N'admin', getdate(), N'', NULL, N'缓存列表菜单') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (113, N'缓存监控', 2, 5, N'cache', N'monitor/cache/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:cache:list', N'redis', N'admin', getdate(), N'', NULL, N'缓存监控菜单') +INSERT sys_menu VALUES (113, N'缓存监控', 2, 5, N'cache', N'monitor/cache/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:cache:list', N'redis', N'admin', getdate(), N'', NULL, N'缓存监控菜单') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (114, N'表单构建', 3, 1, N'build', N'tool/build/index', N'', 1, 0, N'C', N'0', N'0', N'tool:build:list', N'build', N'admin', getdate(), N'', NULL, N'表单构建菜单') +INSERT sys_menu VALUES (114, N'表单构建', 3, 1, N'build', N'tool/build/index', N'', 1, 0, N'C', N'0', N'0', N'tool:build:list', N'build', N'admin', getdate(), N'', NULL, N'表单构建菜单') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (115, N'代码生成', 3, 2, N'gen', N'tool/gen/index', N'', 1, 0, N'C', N'0', N'0', N'tool:gen:list', N'code', N'admin', getdate(), N'', NULL, N'代码生成菜单') +INSERT sys_menu VALUES (115, N'代码生成', 3, 2, N'gen', N'tool/gen/index', N'', 1, 0, N'C', N'0', N'0', N'tool:gen:list', N'code', N'admin', getdate(), N'', NULL, N'代码生成菜单') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (117, N'Admin监控', 2, 5, N'Admin', N'monitor/admin/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:admin:list', N'dashboard', N'admin', getdate(), N'', NULL, N'Admin监控菜单'); +INSERT sys_menu VALUES (117, N'Admin监控', 2, 5, N'Admin', N'monitor/admin/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:admin:list', N'dashboard', N'admin', getdate(), N'', NULL, N'Admin监控菜单'); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (118, N'文件管理', 1, 10, N'oss', N'system/oss/index', N'', 1, 0, N'C', '0', N'0', N'system:oss:list', N'upload', N'admin', getdate(), N'', NULL, N'文件管理菜单'); +INSERT sys_menu VALUES (118, N'文件管理', 1, 10, N'oss', N'system/oss/index', N'', 1, 0, N'C', '0', N'0', N'system:oss:list', N'upload', N'admin', getdate(), N'', NULL, N'文件管理菜单'); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (120, N'任务调度中心', 2, 5, N'XxlJob', N'monitor/xxljob/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:xxljob:list', N'job', N'admin', getdate(), N'', NULL, N'Xxl-Job控制台菜单'); +INSERT sys_menu VALUES (120, N'任务调度中心', 2, 5, N'XxlJob', N'monitor/xxljob/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:xxljob:list', N'job', N'admin', getdate(), N'', NULL, N'Xxl-Job控制台菜单'); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (500, N'操作日志', 108, 1, N'operlog', N'monitor/operlog/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:operlog:list', N'form', N'admin', getdate(), N'', NULL, N'操作日志菜单') +INSERT sys_menu VALUES (500, N'操作日志', 108, 1, N'operlog', N'monitor/operlog/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:operlog:list', N'form', N'admin', getdate(), N'', NULL, N'操作日志菜单') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (501, N'登录日志', 108, 2, N'logininfor', N'monitor/logininfor/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:logininfor:list', N'logininfor', N'admin', getdate(), N'', NULL, N'登录日志菜单') +INSERT sys_menu VALUES (501, N'登录日志', 108, 2, N'logininfor', N'monitor/logininfor/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:logininfor:list', N'logininfor', N'admin', getdate(), N'', NULL, N'登录日志菜单') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1001, N'用户查询', 100, 1, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:query', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1001, N'用户查询', 100, 1, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:query', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1002, N'用户新增', 100, 2, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:add', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1002, N'用户新增', 100, 2, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:add', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1003, N'用户修改', 100, 3, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:edit', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1003, N'用户修改', 100, 3, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:edit', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1004, N'用户删除', 100, 4, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:remove', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1004, N'用户删除', 100, 4, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:remove', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1005, N'用户导出', 100, 5, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:export', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1005, N'用户导出', 100, 5, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:export', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1006, N'用户导入', 100, 6, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:import', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1006, N'用户导入', 100, 6, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:import', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1007, N'重置密码', 100, 7, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:resetPwd', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1007, N'重置密码', 100, 7, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:resetPwd', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1008, N'角色查询', 101, 1, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:role:query', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1008, N'角色查询', 101, 1, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:role:query', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1009, N'角色新增', 101, 2, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:role:add', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1009, N'角色新增', 101, 2, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:role:add', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1010, N'角色修改', 101, 3, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:role:edit', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1010, N'角色修改', 101, 3, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:role:edit', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1011, N'角色删除', 101, 4, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:role:remove', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1011, N'角色删除', 101, 4, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:role:remove', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1012, N'角色导出', 101, 5, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:role:export', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1012, N'角色导出', 101, 5, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:role:export', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1013, N'菜单查询', 102, 1, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:menu:query', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1013, N'菜单查询', 102, 1, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:menu:query', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1014, N'菜单新增', 102, 2, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:menu:add', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1014, N'菜单新增', 102, 2, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:menu:add', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1015, N'菜单修改', 102, 3, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:menu:edit', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1015, N'菜单修改', 102, 3, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:menu:edit', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1016, N'菜单删除', 102, 4, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:menu:remove', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1016, N'菜单删除', 102, 4, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:menu:remove', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1017, N'部门查询', 103, 1, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dept:query', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1017, N'部门查询', 103, 1, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dept:query', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1018, N'部门新增', 103, 2, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dept:add', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1018, N'部门新增', 103, 2, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dept:add', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1019, N'部门修改', 103, 3, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dept:edit', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1019, N'部门修改', 103, 3, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dept:edit', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1020, N'部门删除', 103, 4, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dept:remove', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1020, N'部门删除', 103, 4, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dept:remove', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1021, N'岗位查询', 104, 1, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:post:query', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1021, N'岗位查询', 104, 1, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:post:query', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1022, N'岗位新增', 104, 2, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:post:add', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1022, N'岗位新增', 104, 2, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:post:add', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1023, N'岗位修改', 104, 3, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:post:edit', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1023, N'岗位修改', 104, 3, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:post:edit', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1024, N'岗位删除', 104, 4, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:post:remove', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1024, N'岗位删除', 104, 4, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:post:remove', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1025, N'岗位导出', 104, 5, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:post:export', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1025, N'岗位导出', 104, 5, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:post:export', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1026, N'字典查询', 105, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dict:query', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1026, N'字典查询', 105, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dict:query', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1027, N'字典新增', 105, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dict:add', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1027, N'字典新增', 105, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dict:add', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1028, N'字典修改', 105, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dict:edit', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1028, N'字典修改', 105, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dict:edit', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1029, N'字典删除', 105, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dict:remove', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1029, N'字典删除', 105, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dict:remove', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1030, N'字典导出', 105, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dict:export', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1030, N'字典导出', 105, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dict:export', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1031, N'参数查询', 106, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:config:query', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1031, N'参数查询', 106, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:config:query', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1032, N'参数新增', 106, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:config:add', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1032, N'参数新增', 106, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:config:add', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1033, N'参数修改', 106, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:config:edit', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1033, N'参数修改', 106, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:config:edit', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1034, N'参数删除', 106, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:config:remove', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1034, N'参数删除', 106, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:config:remove', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1035, N'参数导出', 106, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:config:export', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1035, N'参数导出', 106, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:config:export', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1036, N'公告查询', 107, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:notice:query', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1036, N'公告查询', 107, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:notice:query', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1037, N'公告新增', 107, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:notice:add', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1037, N'公告新增', 107, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:notice:add', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1038, N'公告修改', 107, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:notice:edit', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1038, N'公告修改', 107, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:notice:edit', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1039, N'公告删除', 107, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:notice:remove', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1039, N'公告删除', 107, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:notice:remove', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1040, N'操作查询', 500, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:operlog:query', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1040, N'操作查询', 500, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:operlog:query', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1041, N'操作删除', 500, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:operlog:remove', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1041, N'操作删除', 500, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:operlog:remove', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1042, N'日志导出', 500, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:operlog:export', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1042, N'日志导出', 500, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:operlog:export', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1043, N'登录查询', 501, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:logininfor:query', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1043, N'登录查询', 501, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:logininfor:query', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1044, N'登录删除', 501, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:logininfor:remove', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1044, N'登录删除', 501, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:logininfor:remove', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1045, N'日志导出', 501, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:logininfor:export', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1045, N'日志导出', 501, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:logininfor:export', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1050, N'账户解锁', 501, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:logininfor:unlock', N'#', N'admin', getdate(), N'', null, N'') +INSERT sys_menu VALUES (1050, N'账户解锁', 501, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:logininfor:unlock', N'#', N'admin', getdate(), N'', null, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1046, N'在线查询', 109, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:online:query', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1046, N'在线查询', 109, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:online:query', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1047, N'批量强退', 109, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:online:batchLogout', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1047, N'批量强退', 109, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:online:batchLogout', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1048, N'单条强退', 109, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:online:forceLogout', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1048, N'单条强退', 109, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:online:forceLogout', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1055, N'生成查询', 115, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:query', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1055, N'生成查询', 115, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:query', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1056, N'生成修改', 115, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:edit', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1056, N'生成修改', 115, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:edit', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1057, N'生成删除', 115, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:remove', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1057, N'生成删除', 115, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:remove', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1058, N'导入代码', 115, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:import', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1058, N'导入代码', 115, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:import', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1059, N'预览代码', 115, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:preview', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1059, N'预览代码', 115, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:preview', N'#', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1060, N'生成代码', 115, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:code', N'#', N'admin', getdate(), N'', NULL, N'') +INSERT sys_menu VALUES (1060, N'生成代码', 115, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:code', N'#', N'admin', getdate(), N'', NULL, N'') GO -- oss相关按钮 -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1600, N'文件查询', 118, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:query', N'#', N'admin', getdate(), N'', NULL, N''); +INSERT sys_menu VALUES (1600, N'文件查询', 118, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:query', N'#', N'admin', getdate(), N'', NULL, N''); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1601, N'文件上传', 118, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:upload', N'#', N'admin', getdate(), N'', NULL, N''); +INSERT sys_menu VALUES (1601, N'文件上传', 118, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:upload', N'#', N'admin', getdate(), N'', NULL, N''); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1602, N'文件下载', 118, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:download', N'#', N'admin', getdate(), N'', NULL, N''); +INSERT sys_menu VALUES (1602, N'文件下载', 118, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:download', N'#', N'admin', getdate(), N'', NULL, N''); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1603, N'文件删除', 118, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:remove', N'#', N'admin', getdate(), N'', NULL, N''); +INSERT sys_menu VALUES (1603, N'文件删除', 118, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:remove', N'#', N'admin', getdate(), N'', NULL, N''); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1604, N'配置添加', 118, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:add', N'#', N'admin', getdate(), N'', NULL, N''); +INSERT sys_menu VALUES (1604, N'配置添加', 118, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:add', N'#', N'admin', getdate(), N'', NULL, N''); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1605, N'配置编辑', 118, 6, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:edit', N'#', N'admin', getdate(), N'', NULL, N''); +INSERT sys_menu VALUES (1605, N'配置编辑', 118, 6, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:edit', N'#', N'admin', getdate(), N'', NULL, N''); GO -CREATE TABLE [sys_notice] +CREATE TABLE sys_notice ( - [notice_id] bigint NOT NULL, - [notice_title] nvarchar(50) NOT NULL, - [notice_type] nchar(1) NOT NULL, - [notice_content] nvarchar(max) NULL, - [status] nchar(1) DEFAULT ('0') NULL, - [create_by] nvarchar(64) DEFAULT '' NULL, - [create_time] datetime2(7) NULL, - [update_by] nvarchar(64) DEFAULT '' NULL, - [update_time] datetime2(7) NULL, - [remark] nvarchar(255) NULL, - CONSTRAINT [PK__sys_noti__3E82A5DB0EC94801] PRIMARY KEY CLUSTERED ([notice_id]) + notice_id bigint NOT NULL, + notice_title nvarchar(50) NOT NULL, + notice_type nchar(1) NOT NULL, + notice_content nvarchar(max) NULL, + status nchar(1) DEFAULT ('0') NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + remark nvarchar(255) NULL, + CONSTRAINT PK__sys_noti__3E82A5DB0EC94801 PRIMARY KEY CLUSTERED (notice_id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -1306,30 +1294,30 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_notice' GO -INSERT [sys_notice] ([notice_id], [notice_title], [notice_type], [notice_content], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1, N'温馨提醒:2018-07-01 若依新版本发布啦', N'2', N'

1111111111

', N'0', N'admin', getdate(), N'admin', getdate(), N'管理员') +INSERT sys_notice VALUES (1, N'温馨提醒:2018-07-01 若依新版本发布啦', N'2', N'新版本内容', N'0', N'admin', getdate(), N'admin', getdate(), N'管理员') GO -INSERT [sys_notice] ([notice_id], [notice_title], [notice_type], [notice_content], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (2, N'维护通知:2018-07-01 若依系统凌晨维护', N'1', N'

', N'0', N'admin', getdate(), N'admin', getdate(), N'管理员') +INSERT sys_notice VALUES (2, N'维护通知:2018-07-01 若依系统凌晨维护', N'1', N'维护内容', N'0', N'admin', getdate(), N'admin', getdate(), N'管理员') GO -CREATE TABLE [sys_oper_log] +CREATE TABLE sys_oper_log ( - [oper_id] bigint NOT NULL, - [title] nvarchar(50) DEFAULT '' NULL, - [business_type] int DEFAULT ((0)) NULL, - [method] nvarchar(100) DEFAULT '' NULL, - [request_method] nvarchar(10) DEFAULT '' NULL, - [operator_type] int DEFAULT ((0)) NULL, - [oper_name] nvarchar(50) DEFAULT '' NULL, - [dept_name] nvarchar(50) DEFAULT '' NULL, - [oper_url] nvarchar(255) DEFAULT '' NULL, - [oper_ip] nvarchar(128) DEFAULT '' NULL, - [oper_location] nvarchar(255) DEFAULT '' NULL, - [oper_param] nvarchar(2000) DEFAULT '' NULL, - [json_result] nvarchar(2000) DEFAULT '' NULL, - [status] int DEFAULT ((0)) NULL, - [error_msg] nvarchar(2000) DEFAULT '' NULL, - [oper_time] datetime2(7) NULL, - CONSTRAINT [PK__sys_oper__34723BF9BD954573] PRIMARY KEY CLUSTERED ([oper_id]) + oper_id bigint NOT NULL, + title nvarchar(50) DEFAULT '' NULL, + business_type int DEFAULT ((0)) NULL, + method nvarchar(100) DEFAULT '' NULL, + request_method nvarchar(10) DEFAULT '' NULL, + operator_type int DEFAULT ((0)) NULL, + oper_name nvarchar(50) DEFAULT '' NULL, + dept_name nvarchar(50) DEFAULT '' NULL, + oper_url nvarchar(255) DEFAULT '' NULL, + oper_ip nvarchar(128) DEFAULT '' NULL, + oper_location nvarchar(255) DEFAULT '' NULL, + oper_param nvarchar(2000) DEFAULT '' NULL, + json_result nvarchar(2000) DEFAULT '' NULL, + status int DEFAULT ((0)) NULL, + error_msg nvarchar(2000) DEFAULT '' NULL, + oper_time datetime2(7) NULL, + CONSTRAINT PK__sys_oper__34723BF9BD954573 PRIMARY KEY CLUSTERED (oper_id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -1438,19 +1426,19 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_oper_log' GO -CREATE TABLE [sys_post] +CREATE TABLE sys_post ( - [post_id] bigint NOT NULL, - [post_code] nvarchar(64) NOT NULL, - [post_name] nvarchar(50) NOT NULL, - [post_sort] int NOT NULL, - [status] nchar(1) NOT NULL, - [create_by] nvarchar(64) DEFAULT '' NULL, - [create_time] datetime2(7) NULL, - [update_by] nvarchar(64) DEFAULT '' NULL, - [update_time] datetime2(7) NULL, - [remark] nvarchar(500) NULL, - CONSTRAINT [PK__sys_post__3ED7876668E2D081] PRIMARY KEY CLUSTERED ([post_id]) + post_id bigint NOT NULL, + post_code nvarchar(64) NOT NULL, + post_name nvarchar(50) NOT NULL, + post_sort int NOT NULL, + status nchar(1) NOT NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + remark nvarchar(500) NULL, + CONSTRAINT PK__sys_post__3ED7876668E2D081 PRIMARY KEY CLUSTERED (post_id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -1523,32 +1511,32 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_post' GO -INSERT [sys_post] ([post_id], [post_code], [post_name], [post_sort], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1, N'ceo', N'董事长', 1, N'0', N'admin', getdate(), N'', NULL, N'') +INSERT sys_post VALUES (1, N'ceo', N'董事长', 1, N'0', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_post] ([post_id], [post_code], [post_name], [post_sort], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (2, N'se', N'项目经理', 2, N'0', N'admin', getdate(), N'', NULL, N'') +INSERT sys_post VALUES (2, N'se', N'项目经理', 2, N'0', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_post] ([post_id], [post_code], [post_name], [post_sort], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (3, N'hr', N'人力资源', 3, N'0', N'admin', getdate(), N'', NULL, N'') +INSERT sys_post VALUES (3, N'hr', N'人力资源', 3, N'0', N'admin', getdate(), N'', NULL, N'') GO -INSERT [sys_post] ([post_id], [post_code], [post_name], [post_sort], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (4, N'user', N'普通员工', 4, N'0', N'admin', getdate(), N'', NULL, N'') +INSERT sys_post VALUES (4, N'user', N'普通员工', 4, N'0', N'admin', getdate(), N'', NULL, N'') GO -CREATE TABLE [sys_role] +CREATE TABLE sys_role ( - [role_id] bigint NOT NULL, - [role_name] nvarchar(30) NOT NULL, - [role_key] nvarchar(100) NOT NULL, - [role_sort] int NOT NULL, - [data_scope] nchar(1) DEFAULT ('1') NULL, - [menu_check_strictly] tinyint DEFAULT ((1)) NULL, - [dept_check_strictly] tinyint DEFAULT ((1)) NULL, - [status] nchar(1) NOT NULL, - [del_flag] nchar(1) DEFAULT ('0') NULL, - [create_by] nvarchar(64) DEFAULT '' NULL, - [create_time] datetime2(7) NULL, - [update_by] nvarchar(64) DEFAULT '' NULL, - [update_time] datetime2(7) NULL, - [remark] nvarchar(500) NULL, - CONSTRAINT [PK__sys_role__760965CCF9383145] PRIMARY KEY CLUSTERED ([role_id]) + role_id bigint NOT NULL, + role_name nvarchar(30) NOT NULL, + role_key nvarchar(100) NOT NULL, + role_sort int NOT NULL, + data_scope nchar(1) DEFAULT ('1') NULL, + menu_check_strictly tinyint DEFAULT ((1)) NULL, + dept_check_strictly tinyint DEFAULT ((1)) NULL, + status nchar(1) NOT NULL, + del_flag nchar(1) DEFAULT ('0') NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + remark nvarchar(500) NULL, + CONSTRAINT PK__sys_role__760965CCF9383145 PRIMARY KEY CLUSTERED (role_id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -1645,16 +1633,16 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_role' GO -INSERT [sys_role] ([role_id], [role_name], [role_key], [role_sort], [data_scope], [menu_check_strictly], [dept_check_strictly], [status], [del_flag], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1, N'超级管理员', N'admin', 1, N'1', 1, 1, N'0', N'0', N'admin', getdate(), N'', NULL, N'超级管理员') +INSERT sys_role VALUES (1, N'超级管理员', N'admin', 1, N'1', 1, 1, N'0', N'0', N'admin', getdate(), N'', NULL, N'超级管理员') GO -INSERT [sys_role] ([role_id], [role_name], [role_key], [role_sort], [data_scope], [menu_check_strictly], [dept_check_strictly], [status], [del_flag], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (2, N'普通角色', N'common', 2, N'2', 1, 1, N'0', N'0', N'admin', getdate(), N'admin', CAST(N'2021-12-04T15:44:20.0000000' AS DateTime2), N'普通角色') +INSERT sys_role VALUES (2, N'普通角色', N'common', 2, N'2', 1, 1, N'0', N'0', N'admin', getdate(), N'', NULL, N'普通角色') GO -CREATE TABLE [sys_role_dept] +CREATE TABLE sys_role_dept ( - [role_id] bigint NOT NULL, - [dept_id] bigint NOT NULL, - CONSTRAINT [PK__sys_role__2BC3005BABBCA08A] PRIMARY KEY CLUSTERED ([role_id], [dept_id]) + role_id bigint NOT NULL, + dept_id bigint NOT NULL, + CONSTRAINT PK__sys_role__2BC3005BABBCA08A PRIMARY KEY CLUSTERED (role_id, dept_id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -1679,18 +1667,18 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_role_dept' GO -INSERT [sys_role_dept] ([role_id], [dept_id]) VALUES (2, 100) +INSERT sys_role_dept VALUES (2, 100) GO -INSERT [sys_role_dept] ([role_id], [dept_id]) VALUES (2, 101) +INSERT sys_role_dept VALUES (2, 101) GO -INSERT [sys_role_dept] ([role_id], [dept_id]) VALUES (2, 105) +INSERT sys_role_dept VALUES (2, 105) GO -CREATE TABLE [sys_role_menu] +CREATE TABLE sys_role_menu ( - [role_id] bigint NOT NULL, - [menu_id] bigint NOT NULL, - CONSTRAINT [PK__sys_role__A2C36A6187BA4B17] PRIMARY KEY CLUSTERED ([role_id], [menu_id]) + role_id bigint NOT NULL, + menu_id bigint NOT NULL, + CONSTRAINT PK__sys_role__A2C36A6187BA4B17 PRIMARY KEY CLUSTERED (role_id, menu_id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -1715,193 +1703,193 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_role_menu' GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1) +INSERT sys_role_menu VALUES (2, 1) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 2) +INSERT sys_role_menu VALUES (2, 2) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 3) +INSERT sys_role_menu VALUES (2, 3) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 100) +INSERT sys_role_menu VALUES (2, 100) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 101) +INSERT sys_role_menu VALUES (2, 101) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 102) +INSERT sys_role_menu VALUES (2, 102) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 103) +INSERT sys_role_menu VALUES (2, 103) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 104) +INSERT sys_role_menu VALUES (2, 104) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 105) +INSERT sys_role_menu VALUES (2, 105) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 106) +INSERT sys_role_menu VALUES (2, 106) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 107) +INSERT sys_role_menu VALUES (2, 107) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 108) +INSERT sys_role_menu VALUES (2, 108) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 109) +INSERT sys_role_menu VALUES (2, 109) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 110) +INSERT sys_role_menu VALUES (2, 110) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 111) +INSERT sys_role_menu VALUES (2, 111) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 112) +INSERT sys_role_menu VALUES (2, 112) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 113) +INSERT sys_role_menu VALUES (2, 113) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 114) +INSERT sys_role_menu VALUES (2, 114) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 115) +INSERT sys_role_menu VALUES (2, 115) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 116) +INSERT sys_role_menu VALUES (2, 116) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 500) +INSERT sys_role_menu VALUES (2, 500) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 501) +INSERT sys_role_menu VALUES (2, 501) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1001) +INSERT sys_role_menu VALUES (2, 1001) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1002) +INSERT sys_role_menu VALUES (2, 1002) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1003) +INSERT sys_role_menu VALUES (2, 1003) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1004) +INSERT sys_role_menu VALUES (2, 1004) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1005) +INSERT sys_role_menu VALUES (2, 1005) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1006) +INSERT sys_role_menu VALUES (2, 1006) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1007) +INSERT sys_role_menu VALUES (2, 1007) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1008) +INSERT sys_role_menu VALUES (2, 1008) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1009) +INSERT sys_role_menu VALUES (2, 1009) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1010) +INSERT sys_role_menu VALUES (2, 1010) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1011) +INSERT sys_role_menu VALUES (2, 1011) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1012) +INSERT sys_role_menu VALUES (2, 1012) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1013) +INSERT sys_role_menu VALUES (2, 1013) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1014) +INSERT sys_role_menu VALUES (2, 1014) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1015) +INSERT sys_role_menu VALUES (2, 1015) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1016) +INSERT sys_role_menu VALUES (2, 1016) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1017) +INSERT sys_role_menu VALUES (2, 1017) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1018) +INSERT sys_role_menu VALUES (2, 1018) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1019) +INSERT sys_role_menu VALUES (2, 1019) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1020) +INSERT sys_role_menu VALUES (2, 1020) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1021) +INSERT sys_role_menu VALUES (2, 1021) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1022) +INSERT sys_role_menu VALUES (2, 1022) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1023) +INSERT sys_role_menu VALUES (2, 1023) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1024) +INSERT sys_role_menu VALUES (2, 1024) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1025) +INSERT sys_role_menu VALUES (2, 1025) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1026) +INSERT sys_role_menu VALUES (2, 1026) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1027) +INSERT sys_role_menu VALUES (2, 1027) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1028) +INSERT sys_role_menu VALUES (2, 1028) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1029) +INSERT sys_role_menu VALUES (2, 1029) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1030) +INSERT sys_role_menu VALUES (2, 1030) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1031) +INSERT sys_role_menu VALUES (2, 1031) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1032) +INSERT sys_role_menu VALUES (2, 1032) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1033) +INSERT sys_role_menu VALUES (2, 1033) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1034) +INSERT sys_role_menu VALUES (2, 1034) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1035) +INSERT sys_role_menu VALUES (2, 1035) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1036) +INSERT sys_role_menu VALUES (2, 1036) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1037) +INSERT sys_role_menu VALUES (2, 1037) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1038) +INSERT sys_role_menu VALUES (2, 1038) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1039) +INSERT sys_role_menu VALUES (2, 1039) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1040) +INSERT sys_role_menu VALUES (2, 1040) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1041) +INSERT sys_role_menu VALUES (2, 1041) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1042) +INSERT sys_role_menu VALUES (2, 1042) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1043) +INSERT sys_role_menu VALUES (2, 1043) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1044) +INSERT sys_role_menu VALUES (2, 1044) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1045) +INSERT sys_role_menu VALUES (2, 1045) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1046) +INSERT sys_role_menu VALUES (2, 1046) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1047) +INSERT sys_role_menu VALUES (2, 1047) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1048) +INSERT sys_role_menu VALUES (2, 1048) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1049) +INSERT sys_role_menu VALUES (2, 1049) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1050) +INSERT sys_role_menu VALUES (2, 1050) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1051) +INSERT sys_role_menu VALUES (2, 1051) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1052) +INSERT sys_role_menu VALUES (2, 1052) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1053) +INSERT sys_role_menu VALUES (2, 1053) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1054) +INSERT sys_role_menu VALUES (2, 1054) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1055) +INSERT sys_role_menu VALUES (2, 1055) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1056) +INSERT sys_role_menu VALUES (2, 1056) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1057) +INSERT sys_role_menu VALUES (2, 1057) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1058) +INSERT sys_role_menu VALUES (2, 1058) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1059) +INSERT sys_role_menu VALUES (2, 1059) GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1060) +INSERT sys_role_menu VALUES (2, 1060) GO -CREATE TABLE [sys_user] +CREATE TABLE sys_user ( - [user_id] bigint NOT NULL, - [dept_id] bigint NULL, - [user_name] nvarchar(30) NOT NULL, - [nick_name] nvarchar(30) NOT NULL, - [user_type] nvarchar(10) DEFAULT ('sys_user') NULL, - [email] nvarchar(50) DEFAULT '' NULL, - [phonenumber] nvarchar(11) DEFAULT '' NULL, - [sex] nchar(1) DEFAULT ('0') NULL, - [avatar] nvarchar(100) DEFAULT '' NULL, - [password] nvarchar(100) DEFAULT '' NULL, - [status] nchar(1) DEFAULT ('0') NULL, - [del_flag] nchar(1) DEFAULT ('0') NULL, - [login_ip] nvarchar(128) DEFAULT '' NULL, - [login_date] datetime2(7) NULL, - [create_by] nvarchar(64) DEFAULT '' NULL, - [create_time] datetime2(7) NULL, - [update_by] nvarchar(64) DEFAULT '' NULL, - [update_time] datetime2(7) NULL, - [remark] nvarchar(500) NULL, - CONSTRAINT [PK__sys_user__B9BE370F79170B6A] PRIMARY KEY CLUSTERED ([user_id]) + user_id bigint NOT NULL, + dept_id bigint NULL, + user_name nvarchar(30) NOT NULL, + nick_name nvarchar(30) NOT NULL, + user_type nvarchar(10) DEFAULT ('sys_user') NULL, + email nvarchar(50) DEFAULT '' NULL, + phonenumber nvarchar(11) DEFAULT '' NULL, + sex nchar(1) DEFAULT ('0') NULL, + avatar nvarchar(100) DEFAULT '' NULL, + password nvarchar(100) DEFAULT '' NULL, + status nchar(1) DEFAULT ('0') NULL, + del_flag nchar(1) DEFAULT ('0') NULL, + login_ip nvarchar(128) DEFAULT '' NULL, + login_date datetime2(7) NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + remark nvarchar(500) NULL, + CONSTRAINT PK__sys_user__B9BE370F79170B6A PRIMARY KEY CLUSTERED (user_id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -2028,16 +2016,16 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_user' GO -INSERT [sys_user] ([user_id], [dept_id], [user_name], [nick_name], [user_type], [email], [phonenumber], [sex], [avatar], [password], [status], [del_flag], [login_ip], [login_date], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1, 103, N'admin', N'疯狂的狮子Li', N'sys_user', N'crazyLionLi@163.com', N'15888888888', N'1', N'', N'$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', N'0', N'0', N'127.0.0.1', getdate(), N'admin', getdate(), N'', getdate(), N'管理员') +INSERT sys_user VALUES (1, 103, N'admin', N'疯狂的狮子Li', N'sys_user', N'crazyLionLi@163.com', N'15888888888', N'1', N'', N'$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', N'0', N'0', N'127.0.0.1', getdate(), N'admin', getdate(), N'', getdate(), N'管理员') GO -INSERT [sys_user] ([user_id], [dept_id], [user_name], [nick_name], [user_type], [email], [phonenumber], [sex], [avatar], [password], [status], [del_flag], [login_ip], [login_date], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (2, 105, N'ry', N'疯狂的狮子Li', N'sys_user', N'crazyLionLi@qq.com', N'15666666666', N'1', N'', N'$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', N'0', N'0', N'127.0.0.1', getdate(), N'admin', getdate(), N'admin', getdate(), N'测试员') +INSERT sys_user VALUES (2, 105, N'lionli', N'疯狂的狮子Li', N'sys_user', N'crazyLionLi@qq.com', N'15666666666', N'1', N'', N'$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', N'0', N'0', N'127.0.0.1', getdate(), N'admin', getdate(), N'admin', getdate(), N'测试员') GO -CREATE TABLE [sys_user_post] +CREATE TABLE sys_user_post ( - [user_id] bigint NOT NULL, - [post_id] bigint NOT NULL, - CONSTRAINT [PK__sys_user__CA534F799C04589B] PRIMARY KEY CLUSTERED ([user_id], [post_id]) + user_id bigint NOT NULL, + post_id bigint NOT NULL, + CONSTRAINT PK__sys_user__CA534F799C04589B PRIMARY KEY CLUSTERED (user_id, post_id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -2062,16 +2050,16 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_user_post' GO -INSERT [sys_user_post] ([user_id], [post_id]) VALUES (1, 1) +INSERT sys_user_post VALUES (1, 1) GO -INSERT [sys_user_post] ([user_id], [post_id]) VALUES (2, 2) +INSERT sys_user_post VALUES (2, 2) GO -CREATE TABLE [sys_user_role] +CREATE TABLE sys_user_role ( - [user_id] bigint NOT NULL, - [role_id] bigint NOT NULL, - CONSTRAINT [PK__sys_user__6EDEA153FB34D8F0] PRIMARY KEY CLUSTERED ([user_id], [role_id]) + user_id bigint NOT NULL, + role_id bigint NOT NULL, + CONSTRAINT PK__sys_user__6EDEA153FB34D8F0 PRIMARY KEY CLUSTERED (user_id, role_id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -2096,24 +2084,24 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_user_role' GO -INSERT [sys_user_role] ([user_id], [role_id]) VALUES (1, 1) +INSERT sys_user_role VALUES (1, 1) GO -INSERT [sys_user_role] ([user_id], [role_id]) VALUES (2, 2) +INSERT sys_user_role VALUES (2, 2) GO -CREATE TABLE [sys_oss] +CREATE TABLE sys_oss ( - [oss_id] bigint NOT NULL, - [file_name] nvarchar(255) DEFAULT '' NOT NULL, - [original_name] nvarchar(255) DEFAULT '' NOT NULL, - [file_suffix] nvarchar(10) DEFAULT '' NOT NULL, - [url] nvarchar(500) NOT NULL, - [create_time] datetime2(7) NULL, - [create_by] nvarchar(64) DEFAULT '' NULL, - [update_time] datetime2(7) NULL, - [update_by] nvarchar(64) DEFAULT '' NULL, - [service] nvarchar(20) DEFAULT ('minio') NOT NULL, - CONSTRAINT [PK__sys_oss__91241EA442389F0D] PRIMARY KEY CLUSTERED ([oss_id]) + oss_id bigint NOT NULL, + file_name nvarchar(255) DEFAULT '' NOT NULL, + original_name nvarchar(255) DEFAULT '' NOT NULL, + file_suffix nvarchar(10) DEFAULT '' NOT NULL, + url nvarchar(500) NOT NULL, + create_time datetime2(7) NULL, + create_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + service nvarchar(20) DEFAULT ('minio') NOT NULL, + CONSTRAINT PK__sys_oss__91241EA442389F0D PRIMARY KEY CLUSTERED (oss_id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -2186,27 +2174,27 @@ EXEC sp_addextendedproperty 'TABLE', N'sys_oss' GO -CREATE TABLE [sys_oss_config] +CREATE TABLE sys_oss_config ( - [oss_config_id] bigint NOT NULL, - [config_key] nvarchar(20) DEFAULT '' NOT NULL, - [access_key] nvarchar(255) DEFAULT '' NULL, - [secret_key] nvarchar(255) DEFAULT '' NULL, - [bucket_name] nvarchar(255) DEFAULT '' NULL, - [prefix] nvarchar(255) DEFAULT '' NULL, - [endpoint] nvarchar(255) DEFAULT '' NULL, - [domain] nvarchar(255) DEFAULT '' NULL, - [is_https] nchar(1) DEFAULT ('N') NULL, - [region] nvarchar(255) DEFAULT '' NULL, - [access_policy] nchar(1) DEFAULT ('1') NOT NULL, - [status] nchar(1) DEFAULT ('1') NULL, - [ext1] nvarchar(255) DEFAULT '' NULL, - [create_by] nvarchar(64) DEFAULT '' NULL, - [create_time] datetime2(7) NULL, - [update_by] nvarchar(64) DEFAULT '' NULL, - [update_time] datetime2(7) NULL, - [remark] nvarchar(500) NULL, - CONSTRAINT [PK__sys_oss___BFBDE87009ED2882] PRIMARY KEY CLUSTERED ([oss_config_id]) + oss_config_id bigint NOT NULL, + config_key nvarchar(20) DEFAULT '' NOT NULL, + access_key nvarchar(255) DEFAULT '' NULL, + secret_key nvarchar(255) DEFAULT '' NULL, + bucket_name nvarchar(255) DEFAULT '' NULL, + prefix nvarchar(255) DEFAULT '' NULL, + endpoint nvarchar(255) DEFAULT '' NULL, + domain nvarchar(255) DEFAULT '' NULL, + is_https nchar(1) DEFAULT ('N') NULL, + region nvarchar(255) DEFAULT '' NULL, + access_policy nchar(1) DEFAULT ('1') NOT NULL, + status nchar(1) DEFAULT ('1') NULL, + ext1 nvarchar(255) DEFAULT '' NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + remark nvarchar(500) NULL, + CONSTRAINT PK__sys_oss___BFBDE87009ED2882 PRIMARY KEY CLUSTERED (oss_config_id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -2327,13 +2315,13 @@ EXEC sp_addextendedproperty 'TABLE', N'sys_oss_config' GO -INSERT INTO [sys_oss_config] ([oss_config_id], [config_key], [access_key], [secret_key], [bucket_name], [prefix], [endpoint], [domain], [is_https], [region], [access_policy], [status], [ext1], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (N'1', N'minio', N'ruoyi', N'ruoyi123', N'ruoyi', N'', N'127.0.0.1:9000', N'',N'N', N'', N'1', N'0', N'', N'admin', getdate(), N'admin', getdate(), NULL) +INSERT INTO sys_oss_config VALUES (N'1', N'minio', N'ruoyi', N'ruoyi123', N'ruoyi', N'', N'127.0.0.1:9000', N'',N'N', N'', N'1', N'0', N'', N'admin', getdate(), N'admin', getdate(), NULL) GO -INSERT INTO [sys_oss_config] ([oss_config_id], [config_key], [access_key], [secret_key], [bucket_name], [prefix], [endpoint], [domain], [is_https], [region], [access_policy], [status], [ext1], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (N'2', N'qiniu', N'XXXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi', N'', N's3-cn-north-1.qiniucs.com', N'',N'N', N'', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL) +INSERT INTO sys_oss_config VALUES (N'2', N'qiniu', N'XXXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi', N'', N's3-cn-north-1.qiniucs.com', N'',N'N', N'', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL) GO -INSERT INTO [sys_oss_config] ([oss_config_id], [config_key], [access_key], [secret_key], [bucket_name], [prefix], [endpoint], [domain], [is_https], [region], [access_policy], [status], [ext1], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (N'3', N'aliyun', N'XXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi', N'', N'oss-cn-beijing.aliyuncs.com', N'',N'N', N'', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL) +INSERT INTO sys_oss_config VALUES (N'3', N'aliyun', N'XXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi', N'', N'oss-cn-beijing.aliyuncs.com', N'',N'N', N'', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL) GO -INSERT INTO [sys_oss_config] ([oss_config_id], [config_key], [access_key], [secret_key], [bucket_name], [prefix], [endpoint], [domain], [is_https], [region], [access_policy], [status], [ext1], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (N'4', N'qcloud', N'XXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi-1250000000', N'', N'cos.ap-beijing.myqcloud.com', N'',N'N', N'ap-beijing', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL) +INSERT INTO sys_oss_config VALUES (N'4', N'qcloud', N'XXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi-1250000000', N'', N'cos.ap-beijing.myqcloud.com', N'',N'N', N'ap-beijing', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL) GO -INSERT INTO [sys_oss_config] ([oss_config_id], [config_key], [access_key], [secret_key], [bucket_name], [prefix], [endpoint], [domain], [is_https], [region], [access_policy], [status], [ext1], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (N'5', N'image', N'ruoyi', N'ruoyi123', N'ruoyi', N'image', N'127.0.0.1:9000', N'',N'N', N'', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL) +INSERT INTO sys_oss_config VALUES (N'5', N'image', N'ruoyi', N'ruoyi123', N'ruoyi', N'image', N'127.0.0.1:9000', N'',N'N', N'', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL) GO diff --git a/script/sql/sqlserver/sqlserver_test.sql b/script/sql/sqlserver/sqlserver_test.sql index 77fead314..234eab7a2 100644 --- a/script/sql/sqlserver/sqlserver_test.sql +++ b/script/sql/sqlserver/sqlserver_test.sql @@ -1,18 +1,18 @@ -CREATE TABLE [test_demo] +CREATE TABLE test_demo ( - [id] bigint NOT NULL, - [dept_id] bigint NULL, - [user_id] bigint NULL, - [order_num] int DEFAULT ((0)) NULL, - [test_key] nvarchar(255) NULL, - [value] nvarchar(255) NULL, - [version] int DEFAULT ((0)) NULL, - [create_time] datetime2(0) NULL, - [create_by] nvarchar(64) NULL, - [update_time] datetime2(0) NULL, - [update_by] nvarchar(64) NULL, - [del_flag] int DEFAULT ((0)) NULL, - CONSTRAINT [PK__test_dem__3213E83F176051C8] PRIMARY KEY CLUSTERED ([id]) + id bigint NOT NULL, + dept_id bigint NULL, + user_id bigint NULL, + order_num int DEFAULT ((0)) NULL, + test_key nvarchar(255) NULL, + value nvarchar(255) NULL, + version int DEFAULT ((0)) NULL, + create_time datetime2(0) NULL, + create_by nvarchar(64) NULL, + update_time datetime2(0) NULL, + update_by nvarchar(64) NULL, + del_flag int DEFAULT ((0)) NULL, + CONSTRAINT PK__test_dem__3213E83F176051C8 PRIMARY KEY CLUSTERED (id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -109,20 +109,20 @@ EXEC sp_addextendedproperty 'TABLE', N'test_demo' GO -CREATE TABLE [test_tree] +CREATE TABLE test_tree ( - [id] bigint NOT NULL, - [parent_id] bigint DEFAULT ((0)) NULL, - [dept_id] bigint NULL, - [user_id] bigint NULL, - [tree_name] nvarchar(255) NULL, - [version] int DEFAULT ((0)) NULL, - [create_time] datetime2(0) NULL, - [create_by] nvarchar(64) NULL, - [update_time] datetime2(0) NULL, - [update_by] nvarchar(64) NULL, - [del_flag] int DEFAULT ((0)) NULL, - CONSTRAINT [PK__test_tre__3213E83FC75A1B63] PRIMARY KEY CLUSTERED ([id]) + id bigint NOT NULL, + parent_id bigint DEFAULT ((0)) NULL, + dept_id bigint NULL, + user_id bigint NULL, + tree_name nvarchar(255) NULL, + version int DEFAULT ((0)) NULL, + create_time datetime2(0) NULL, + create_by nvarchar(64) NULL, + update_time datetime2(0) NULL, + update_by nvarchar(64) NULL, + del_flag int DEFAULT ((0)) NULL, + CONSTRAINT PK__test_tre__3213E83FC75A1B63 PRIMARY KEY CLUSTERED (id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) @@ -212,267 +212,267 @@ EXEC sp_addextendedproperty 'TABLE', N'test_tree' GO -INSERT [sys_user] ([user_id], [dept_id], [user_name], [nick_name], [user_type], [email], [phonenumber], [sex], [avatar], [password], [status], [del_flag], [login_ip], [login_date], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (3, 108, N'test', N'本部门及以下 密码666666', N'sys_user', N'', N'', N'0', N'', N'$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', N'0', N'0', N'127.0.0.1', getdate(), N'admin', getdate(), N'test', getdate(), NULL); +INSERT sys_user VALUES (3, 108, N'test', N'本部门及以下 密码666666', N'sys_user', N'', N'', N'0', N'', N'$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', N'0', N'0', N'127.0.0.1', getdate(), N'admin', getdate(), N'test', getdate(), NULL); GO -INSERT [sys_user] ([user_id], [dept_id], [user_name], [nick_name], [user_type], [email], [phonenumber], [sex], [avatar], [password], [status], [del_flag], [login_ip], [login_date], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (4, 102, N'test1', N'仅本人 密码666666', N'sys_user', N'', N'', N'0', N'', N'$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', N'0', N'0', N'127.0.0.1', getdate(), N'admin', getdate(), N'test1', getdate(), NULL); +INSERT sys_user VALUES (4, 102, N'test1', N'仅本人 密码666666', N'sys_user', N'', N'', N'0', N'', N'$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', N'0', N'0', N'127.0.0.1', getdate(), N'admin', getdate(), N'test1', getdate(), NULL); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (5, N'测试菜单', 0, 5, N'demo', NULL, 1, 0, N'M', N'0', N'0', NULL, N'star', N'admin', getdate(), NULL, NULL, N''); +INSERT sys_menu VALUES (5, N'测试菜单', 0, 5, N'demo', NULL, 1, 0, N'M', N'0', N'0', NULL, N'star', N'admin', getdate(), NULL, NULL, N''); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1500, N'测试单表', 5, 1, N'demo', N'demo/demo/index', 1, 0, N'C', N'0', N'0', N'demo:demo:list', N'#', N'admin', getdate(), N'', NULL, N'测试单表菜单'); +INSERT sys_menu VALUES (1500, N'测试单表', 5, 1, N'demo', N'demo/demo/index', 1, 0, N'C', N'0', N'0', N'demo:demo:list', N'#', N'admin', getdate(), N'', NULL, N'测试单表菜单'); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1501, N'测试单表查询', 1500, 1, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:demo:query', N'#', N'admin', getdate(), N'', NULL, N''); +INSERT sys_menu VALUES (1501, N'测试单表查询', 1500, 1, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:demo:query', N'#', N'admin', getdate(), N'', NULL, N''); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1502, N'测试单表新增', 1500, 2, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:demo:add', N'#', N'admin', getdate(), N'', NULL, N''); +INSERT sys_menu VALUES (1502, N'测试单表新增', 1500, 2, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:demo:add', N'#', N'admin', getdate(), N'', NULL, N''); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1503, N'测试单表修改', 1500, 3, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:demo:edit', N'#', N'admin', getdate(), N'', NULL, N''); +INSERT sys_menu VALUES (1503, N'测试单表修改', 1500, 3, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:demo:edit', N'#', N'admin', getdate(), N'', NULL, N''); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1504, N'测试单表删除', 1500, 4, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:demo:remove', N'#', N'admin', getdate(), N'', NULL, N''); +INSERT sys_menu VALUES (1504, N'测试单表删除', 1500, 4, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:demo:remove', N'#', N'admin', getdate(), N'', NULL, N''); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1505, N'测试单表导出', 1500, 5, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:demo:export', N'#', N'admin', getdate(), N'', NULL, N''); +INSERT sys_menu VALUES (1505, N'测试单表导出', 1500, 5, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:demo:export', N'#', N'admin', getdate(), N'', NULL, N''); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1506, N'测试树表', 5, 1, N'tree', N'demo/tree/index', 1, 0, N'C', N'0', N'0', N'demo:tree:list', N'#', N'admin', getdate(), N'', NULL, N'测试树表菜单'); +INSERT sys_menu VALUES (1506, N'测试树表', 5, 1, N'tree', N'demo/tree/index', 1, 0, N'C', N'0', N'0', N'demo:tree:list', N'#', N'admin', getdate(), N'', NULL, N'测试树表菜单'); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1507, N'测试树表查询', 1506, 1, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:tree:query', N'#', N'admin', getdate(), N'', NULL, N''); +INSERT sys_menu VALUES (1507, N'测试树表查询', 1506, 1, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:tree:query', N'#', N'admin', getdate(), N'', NULL, N''); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1508, N'测试树表新增', 1506, 2, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:tree:add', N'#', N'admin', getdate(), N'', NULL, N''); +INSERT sys_menu VALUES (1508, N'测试树表新增', 1506, 2, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:tree:add', N'#', N'admin', getdate(), N'', NULL, N''); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1509, N'测试树表修改', 1506, 3, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:tree:edit', N'#', N'admin', getdate(), N'', NULL, N''); +INSERT sys_menu VALUES (1509, N'测试树表修改', 1506, 3, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:tree:edit', N'#', N'admin', getdate(), N'', NULL, N''); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1510, N'测试树表删除', 1506, 4, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:tree:remove', N'#', N'admin', getdate(), N'', NULL, N''); +INSERT sys_menu VALUES (1510, N'测试树表删除', 1506, 4, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:tree:remove', N'#', N'admin', getdate(), N'', NULL, N''); GO -INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1511, N'测试树表导出', 1506, 5, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:tree:export', N'#', N'admin', getdate(), N'', NULL, N''); +INSERT sys_menu VALUES (1511, N'测试树表导出', 1506, 5, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:tree:export', N'#', N'admin', getdate(), N'', NULL, N''); GO -INSERT [sys_role] ([role_id], [role_name], [role_key], [role_sort], [data_scope], [menu_check_strictly], [dept_check_strictly], [status], [del_flag], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (3, N'本部门及以下', N'test1', 3, N'4', 1, 1, N'0', N'0', N'admin', getdate(), N'admin', NULL, NULL); +INSERT sys_role VALUES (3, N'本部门及以下', N'test1', 3, N'4', 1, 1, N'0', N'0', N'admin', getdate(), N'admin', NULL, NULL); GO -INSERT [sys_role] ([role_id], [role_name], [role_key], [role_sort], [data_scope], [menu_check_strictly], [dept_check_strictly], [status], [del_flag], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (4, N'仅本人', N'test2', 4, N'5', 1, 1, N'0', N'0', N'admin', getdate(), N'admin', NULL, NULL); +INSERT sys_role VALUES (4, N'仅本人', N'test2', 4, N'5', 1, 1, N'0', N'0', N'admin', getdate(), N'admin', NULL, NULL); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1); +INSERT sys_role_menu VALUES (3, 1); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 5); +INSERT sys_role_menu VALUES (3, 5); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 100); +INSERT sys_role_menu VALUES (3, 100); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 101); +INSERT sys_role_menu VALUES (3, 101); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 102); +INSERT sys_role_menu VALUES (3, 102); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 103); +INSERT sys_role_menu VALUES (3, 103); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 104); +INSERT sys_role_menu VALUES (3, 104); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 105); +INSERT sys_role_menu VALUES (3, 105); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 106); +INSERT sys_role_menu VALUES (3, 106); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 107); +INSERT sys_role_menu VALUES (3, 107); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 108); +INSERT sys_role_menu VALUES (3, 108); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 500); +INSERT sys_role_menu VALUES (3, 500); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 501); +INSERT sys_role_menu VALUES (3, 501); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1001); +INSERT sys_role_menu VALUES (3, 1001); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1002); +INSERT sys_role_menu VALUES (3, 1002); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1003); +INSERT sys_role_menu VALUES (3, 1003); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1004); +INSERT sys_role_menu VALUES (3, 1004); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1005); +INSERT sys_role_menu VALUES (3, 1005); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1006); +INSERT sys_role_menu VALUES (3, 1006); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1007); +INSERT sys_role_menu VALUES (3, 1007); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1008); +INSERT sys_role_menu VALUES (3, 1008); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1009); +INSERT sys_role_menu VALUES (3, 1009); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1010); +INSERT sys_role_menu VALUES (3, 1010); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1011); +INSERT sys_role_menu VALUES (3, 1011); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1012); +INSERT sys_role_menu VALUES (3, 1012); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1013); +INSERT sys_role_menu VALUES (3, 1013); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1014); +INSERT sys_role_menu VALUES (3, 1014); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1015); +INSERT sys_role_menu VALUES (3, 1015); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1016); +INSERT sys_role_menu VALUES (3, 1016); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1017); +INSERT sys_role_menu VALUES (3, 1017); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1018); +INSERT sys_role_menu VALUES (3, 1018); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1019); +INSERT sys_role_menu VALUES (3, 1019); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1020); +INSERT sys_role_menu VALUES (3, 1020); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1021); +INSERT sys_role_menu VALUES (3, 1021); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1022); +INSERT sys_role_menu VALUES (3, 1022); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1023); +INSERT sys_role_menu VALUES (3, 1023); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1024); +INSERT sys_role_menu VALUES (3, 1024); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1025); +INSERT sys_role_menu VALUES (3, 1025); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1026); +INSERT sys_role_menu VALUES (3, 1026); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1027); +INSERT sys_role_menu VALUES (3, 1027); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1028); +INSERT sys_role_menu VALUES (3, 1028); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1029); +INSERT sys_role_menu VALUES (3, 1029); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1030); +INSERT sys_role_menu VALUES (3, 1030); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1031); +INSERT sys_role_menu VALUES (3, 1031); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1032); +INSERT sys_role_menu VALUES (3, 1032); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1033); +INSERT sys_role_menu VALUES (3, 1033); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1034); +INSERT sys_role_menu VALUES (3, 1034); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1035); +INSERT sys_role_menu VALUES (3, 1035); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1036); +INSERT sys_role_menu VALUES (3, 1036); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1037); +INSERT sys_role_menu VALUES (3, 1037); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1038); +INSERT sys_role_menu VALUES (3, 1038); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1039); +INSERT sys_role_menu VALUES (3, 1039); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1040); +INSERT sys_role_menu VALUES (3, 1040); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1041); +INSERT sys_role_menu VALUES (3, 1041); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1042); +INSERT sys_role_menu VALUES (3, 1042); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1043); +INSERT sys_role_menu VALUES (3, 1043); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1044); +INSERT sys_role_menu VALUES (3, 1044); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1045); +INSERT sys_role_menu VALUES (3, 1045); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1500); +INSERT sys_role_menu VALUES (3, 1500); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1501); +INSERT sys_role_menu VALUES (3, 1501); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1502); +INSERT sys_role_menu VALUES (3, 1502); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1503); +INSERT sys_role_menu VALUES (3, 1503); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1504); +INSERT sys_role_menu VALUES (3, 1504); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1505); +INSERT sys_role_menu VALUES (3, 1505); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1506); +INSERT sys_role_menu VALUES (3, 1506); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1507); +INSERT sys_role_menu VALUES (3, 1507); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1508); +INSERT sys_role_menu VALUES (3, 1508); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1509); +INSERT sys_role_menu VALUES (3, 1509); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1510); +INSERT sys_role_menu VALUES (3, 1510); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (3, 1511); +INSERT sys_role_menu VALUES (3, 1511); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (4, 5); +INSERT sys_role_menu VALUES (4, 5); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (4, 1500); +INSERT sys_role_menu VALUES (4, 1500); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (4, 1501); +INSERT sys_role_menu VALUES (4, 1501); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (4, 1502); +INSERT sys_role_menu VALUES (4, 1502); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (4, 1503); +INSERT sys_role_menu VALUES (4, 1503); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (4, 1504); +INSERT sys_role_menu VALUES (4, 1504); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (4, 1505); +INSERT sys_role_menu VALUES (4, 1505); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (4, 1506); +INSERT sys_role_menu VALUES (4, 1506); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (4, 1507); +INSERT sys_role_menu VALUES (4, 1507); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (4, 1508); +INSERT sys_role_menu VALUES (4, 1508); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (4, 1509); +INSERT sys_role_menu VALUES (4, 1509); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (4, 1510); +INSERT sys_role_menu VALUES (4, 1510); GO -INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (4, 1511); +INSERT sys_role_menu VALUES (4, 1511); GO -INSERT [sys_user_role] ([user_id], [role_id]) VALUES (3, 3); +INSERT sys_user_role VALUES (3, 3); GO -INSERT [sys_user_role] ([user_id], [role_id]) VALUES (4, 4); +INSERT sys_user_role VALUES (4, 4); GO -INSERT [test_demo] ([id], [dept_id], [user_id], [order_num], [test_key], [value], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (1, 102, 4, 1, N'测试数据权限', N'测试', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_demo VALUES (1, 102, 4, 1, N'测试数据权限', N'测试', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_demo] ([id], [dept_id], [user_id], [order_num], [test_key], [value], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (2, 102, 3, 2, N'子节点1', N'111', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_demo VALUES (2, 102, 3, 2, N'子节点1', N'111', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_demo] ([id], [dept_id], [user_id], [order_num], [test_key], [value], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (3, 102, 3, 3, N'子节点2', N'222', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_demo VALUES (3, 102, 3, 3, N'子节点2', N'222', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_demo] ([id], [dept_id], [user_id], [order_num], [test_key], [value], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (4, 108, 4, 4, N'测试数据', N'demo', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_demo VALUES (4, 108, 4, 4, N'测试数据', N'demo', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_demo] ([id], [dept_id], [user_id], [order_num], [test_key], [value], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (5, 108, 3, 13, N'子节点11', N'1111', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_demo VALUES (5, 108, 3, 13, N'子节点11', N'1111', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_demo] ([id], [dept_id], [user_id], [order_num], [test_key], [value], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (6, 108, 3, 12, N'子节点22', N'2222', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_demo VALUES (6, 108, 3, 12, N'子节点22', N'2222', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_demo] ([id], [dept_id], [user_id], [order_num], [test_key], [value], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (7, 108, 3, 11, N'子节点33', N'3333', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_demo VALUES (7, 108, 3, 11, N'子节点33', N'3333', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_demo] ([id], [dept_id], [user_id], [order_num], [test_key], [value], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (8, 108, 3, 10, N'子节点44', N'4444', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_demo VALUES (8, 108, 3, 10, N'子节点44', N'4444', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_demo] ([id], [dept_id], [user_id], [order_num], [test_key], [value], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (9, 108, 3, 9, N'子节点55', N'5555', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_demo VALUES (9, 108, 3, 9, N'子节点55', N'5555', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_demo] ([id], [dept_id], [user_id], [order_num], [test_key], [value], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (10, 108, 3, 8, N'子节点66', N'6666', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_demo VALUES (10, 108, 3, 8, N'子节点66', N'6666', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_demo] ([id], [dept_id], [user_id], [order_num], [test_key], [value], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (11, 108, 3, 7, N'子节点77', N'7777', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_demo VALUES (11, 108, 3, 7, N'子节点77', N'7777', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_demo] ([id], [dept_id], [user_id], [order_num], [test_key], [value], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (12, 108, 3, 6, N'子节点88', N'8888', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_demo VALUES (12, 108, 3, 6, N'子节点88', N'8888', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_demo] ([id], [dept_id], [user_id], [order_num], [test_key], [value], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (13, 108, 3, 5, N'子节点99', N'9999', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_demo VALUES (13, 108, 3, 5, N'子节点99', N'9999', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_tree] ([id], [parent_id], [dept_id], [user_id], [tree_name], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (1, 0, 102, 4, N'测试数据权限', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_tree VALUES (1, 0, 102, 4, N'测试数据权限', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_tree] ([id], [parent_id], [dept_id], [user_id], [tree_name], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (2, 1, 102, 3, N'子节点1', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_tree VALUES (2, 1, 102, 3, N'子节点1', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_tree] ([id], [parent_id], [dept_id], [user_id], [tree_name], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (3, 2, 102, 3, N'子节点2', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_tree VALUES (3, 2, 102, 3, N'子节点2', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_tree] ([id], [parent_id], [dept_id], [user_id], [tree_name], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (4, 0, 108, 4, N'测试树1', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_tree VALUES (4, 0, 108, 4, N'测试树1', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_tree] ([id], [parent_id], [dept_id], [user_id], [tree_name], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (5, 4, 108, 3, N'子节点11', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_tree VALUES (5, 4, 108, 3, N'子节点11', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_tree] ([id], [parent_id], [dept_id], [user_id], [tree_name], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (6, 4, 108, 3, N'子节点22', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_tree VALUES (6, 4, 108, 3, N'子节点22', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_tree] ([id], [parent_id], [dept_id], [user_id], [tree_name], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (7, 4, 108, 3, N'子节点33', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_tree VALUES (7, 4, 108, 3, N'子节点33', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_tree] ([id], [parent_id], [dept_id], [user_id], [tree_name], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (8, 5, 108, 3, N'子节点44', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_tree VALUES (8, 5, 108, 3, N'子节点44', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_tree] ([id], [parent_id], [dept_id], [user_id], [tree_name], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (9, 6, 108, 3, N'子节点55', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_tree VALUES (9, 6, 108, 3, N'子节点55', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_tree] ([id], [parent_id], [dept_id], [user_id], [tree_name], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (10, 7, 108, 3, N'子节点66', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_tree VALUES (10, 7, 108, 3, N'子节点66', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_tree] ([id], [parent_id], [dept_id], [user_id], [tree_name], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (11, 7, 108, 3, N'子节点77', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_tree VALUES (11, 7, 108, 3, N'子节点77', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_tree] ([id], [parent_id], [dept_id], [user_id], [tree_name], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (12, 10, 108, 3, N'子节点88', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_tree VALUES (12, 10, 108, 3, N'子节点88', 0, getdate(), N'admin', NULL, NULL, 0); GO -INSERT [test_tree] ([id], [parent_id], [dept_id], [user_id], [tree_name], [version], [create_time], [create_by], [update_time], [update_by], [del_flag]) VALUES (13, 10, 108, 3, N'子节点99', 0, getdate(), N'admin', NULL, NULL, 0); +INSERT test_tree VALUES (13, 10, 108, 3, N'子节点99', 0, getdate(), N'admin', NULL, NULL, 0); GO From 40aeeeced19e9dcc118836ab943b43f2eb594362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=8A=93=E8=9B=99=E5=B8=88?= <770492966@qq.com> Date: Fri, 17 Feb 2023 11:16:17 +0800 Subject: [PATCH 19/34] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=83=A8=E9=97=A8id?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=9F=A5=E8=AF=A2=E5=88=B0=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E7=9A=84=E7=A9=BA=E6=8C=87=E9=92=88=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index ac934f90f..0e8894d7d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -116,6 +116,9 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService { @Override public SysDept selectDeptById(Long deptId) { SysDept dept = baseMapper.selectById(deptId); + if (ObjectUtil.isNull(dept)) { + return null; + } SysDept parentDept = baseMapper.selectOne(new LambdaQueryWrapper() .select(SysDept::getDeptName).eq(SysDept::getDeptId, dept.getParentId())); dept.setParentName(ObjectUtil.isNotNull(parentDept) ? parentDept.getDeptName() : null); From 088002bd62faafcc10ab303a67928cdb0640726b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Fri, 17 Feb 2023 12:48:23 +0800 Subject: [PATCH 20/34] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20encrypt=20?= =?UTF-8?q?=E5=8A=A0=E8=A7=A3=E5=AF=86=E6=A8=A1=E5=9D=97=E8=AF=AD=E6=B3=95?= =?UTF-8?q?=20=E7=AE=80=E5=8C=96=E4=BB=A3=E7=A0=81=E6=B6=88=E9=99=A4?= =?UTF-8?q?=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/framework/encrypt/MybatisDecryptInterceptor.java | 6 +++--- .../ruoyi/framework/encrypt/MybatisEncryptInterceptor.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/encrypt/MybatisDecryptInterceptor.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/encrypt/MybatisDecryptInterceptor.java index c8bbf8f35..abd02c3bc 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/encrypt/MybatisDecryptInterceptor.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/encrypt/MybatisDecryptInterceptor.java @@ -55,11 +55,11 @@ public class MybatisDecryptInterceptor implements Interceptor { * @param sourceObject 待加密对象 */ private void decryptHandler(Object sourceObject) { - if (sourceObject instanceof Map) { - ((Map) sourceObject).values().forEach(this::decryptHandler); + if (sourceObject instanceof Map) { + ((Map) sourceObject).values().forEach(this::decryptHandler); return; } - if (sourceObject instanceof List) { + if (sourceObject instanceof List) { // 判断第一个元素是否含有注解。如果没有直接返回,提高效率 Object firstItem = ((List) sourceObject).get(0); if (CollectionUtil.isEmpty(encryptorManager.getFieldCache(firstItem.getClass()))) { diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/encrypt/MybatisEncryptInterceptor.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/encrypt/MybatisEncryptInterceptor.java index d9c25bcd3..b40745bcb 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/encrypt/MybatisEncryptInterceptor.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/encrypt/MybatisEncryptInterceptor.java @@ -67,11 +67,11 @@ public class MybatisEncryptInterceptor implements Interceptor { */ @SuppressWarnings("unchecked cast") private void encryptHandler(Object sourceObject) { - if (sourceObject instanceof Map) { + if (sourceObject instanceof Map) { ((Map) sourceObject).values().forEach(this::encryptHandler); return; } - if (sourceObject instanceof List) { + if (sourceObject instanceof List) { // 判断第一个元素是否含有注解。如果没有直接返回,提高效率 Object firstItem = ((List) sourceObject).get(0); if (CollectionUtil.isEmpty(encryptorManager.getFieldCache(firstItem.getClass()))) { From 4bd2691422959e2641334f736cd58b49aa2238e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Fri, 17 Feb 2023 12:48:23 +0800 Subject: [PATCH 21/34] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20encrypt=20?= =?UTF-8?q?=E5=8A=A0=E8=A7=A3=E5=AF=86=E6=A8=A1=E5=9D=97=E8=AF=AD=E6=B3=95?= =?UTF-8?q?=20=E7=AE=80=E5=8C=96=E4=BB=A3=E7=A0=81=E6=B6=88=E9=99=A4?= =?UTF-8?q?=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/framework/encrypt/MybatisEncryptInterceptor.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/encrypt/MybatisEncryptInterceptor.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/encrypt/MybatisEncryptInterceptor.java index b40745bcb..0907e089e 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/encrypt/MybatisEncryptInterceptor.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/encrypt/MybatisEncryptInterceptor.java @@ -65,10 +65,9 @@ public class MybatisEncryptInterceptor implements Interceptor { * * @param sourceObject 待加密对象 */ - @SuppressWarnings("unchecked cast") private void encryptHandler(Object sourceObject) { if (sourceObject instanceof Map) { - ((Map) sourceObject).values().forEach(this::encryptHandler); + ((Map) sourceObject).values().forEach(this::encryptHandler); return; } if (sourceObject instanceof List) { From a2c43aceb1553d4850d0f55947f62d863423a4c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Fri, 17 Feb 2023 14:15:33 +0800 Subject: [PATCH 22/34] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E8=A7=92=E8=89=B2=E5=90=8E=E8=B8=A2=E6=8E=89=E6=89=80?= =?UTF-8?q?=E6=9C=89=E7=9B=B8=E5=85=B3=E7=9A=84=E7=99=BB=E5=BD=95=E7=94=A8?= =?UTF-8?q?=E6=88=B7=20=E7=94=A8=E6=88=B7=E9=87=8F=E8=BF=87=E5=A4=A7?= =?UTF-8?q?=E4=BC=9A=E5=AF=BC=E8=87=B4redis=E9=98=BB=E5=A1=9E=E5=8D=A1?= =?UTF-8?q?=E9=A1=BF(=E5=BA=94=E7=B2=89=E4=B8=9D=E8=A6=81=E6=B1=82)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/SysRoleController.java | 25 +++++++++++++++++++ .../com/ruoyi/common/helper/LoginHelper.java | 7 ++++++ 2 files changed, 32 insertions(+) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java index 88bb900bc..f88c5ed4e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java @@ -1,7 +1,11 @@ package com.ruoyi.web.controller.system; import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.exception.NotLoginException; +import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.collection.CollUtil; import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.PageQuery; @@ -9,8 +13,10 @@ import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.helper.LoginHelper; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.service.ISysDeptService; @@ -106,6 +112,25 @@ public class SysRoleController extends BaseController { } if (roleService.updateRole(role) > 0) { + List keys = StpUtil.searchTokenValue("", 0, -1, false); + if (CollUtil.isEmpty(keys)) { + return R.ok(); + } + // 角色关联的在线用户量过大会导致redis阻塞卡顿 谨慎操作 + keys.parallelStream().forEach(key -> { + String token = key.replace(CacheConstants.LOGIN_TOKEN_KEY, ""); + // 如果已经过期则跳过 + if (StpUtil.stpLogic.getTokenActivityTimeoutByToken(token) < -1) { + return; + } + LoginUser loginUser = LoginHelper.getLoginUser(token); + if (loginUser.getRoles().stream().anyMatch(r -> r.getRoleId().equals(role.getRoleId()))) { + try { + StpUtil.logoutByTokenValue(token); + } catch (NotLoginException ignored) { + } + } + }); return R.ok(); } return R.fail("修改角色'" + role.getRoleName() + "'失败,请联系管理员"); diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java b/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java index a4ed27575..2a70a6551 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java @@ -69,6 +69,13 @@ public class LoginHelper { return loginUser; } + /** + * 获取用户基于token + */ + public static LoginUser getLoginUser(String token) { + return ((JSONObject) StpUtil.getExtra(token, LOGIN_USER_KEY)).toBean(LoginUser.class); + } + /** * 获取用户id */ From dadf05c25c7de955cb63f0c3b2a690fe0ae24535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Fri, 17 Feb 2023 22:50:17 +0800 Subject: [PATCH 23/34] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20=E5=9B=A0?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=9D=83=E9=99=90=E8=BF=87=E5=A4=9A=20?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=20token=20=E8=87=83=E8=82=BF=E8=BF=87?= =?UTF-8?q?=E9=95=BF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/core/domain/model/LoginUser.java | 3 +- .../com/ruoyi/common/helper/LoginHelper.java | 53 ++++++++++--------- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java index c93b9efe1..83fcf9fe8 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java @@ -1,7 +1,6 @@ package com.ruoyi.common.core.domain.model; import com.ruoyi.common.core.domain.dto.RoleDTO; -import com.ruoyi.common.helper.LoginHelper; import lombok.Data; import lombok.NoArgsConstructor; @@ -111,7 +110,7 @@ public class LoginUser implements Serializable { if (userId == null) { throw new IllegalArgumentException("用户ID不能为空"); } - return userType + LoginHelper.JOIN_CODE + userId; + return userType + ":" + userId; } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java b/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java index 2a70a6551..50220ea30 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java @@ -9,11 +9,11 @@ import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.enums.DeviceType; import com.ruoyi.common.enums.UserType; -import com.ruoyi.common.exception.UtilException; -import com.ruoyi.common.utils.StringUtils; import lombok.AccessLevel; import lombok.NoArgsConstructor; +import java.util.Set; + /** * 登录鉴权助手 *

@@ -29,8 +29,8 @@ import lombok.NoArgsConstructor; @NoArgsConstructor(access = AccessLevel.PRIVATE) public class LoginHelper { - public static final String JOIN_CODE = ":"; public static final String LOGIN_USER_KEY = "loginUser"; + public static final String MENU_PERMISSION = "menuPermission"; /** * 登录系统 @@ -38,8 +38,7 @@ public class LoginHelper { * @param loginUser 登录用户信息 */ public static void login(LoginUser loginUser) { - SaHolder.getStorage().set(LOGIN_USER_KEY, loginUser); - StpUtil.login(loginUser.getLoginId(), new SaLoginModel().setExtra(LOGIN_USER_KEY, loginUser)); + loginByDevice(loginUser, null); } /** @@ -50,21 +49,30 @@ public class LoginHelper { */ public static void loginByDevice(LoginUser loginUser, DeviceType deviceType) { SaHolder.getStorage().set(LOGIN_USER_KEY, loginUser); - StpUtil.login(loginUser.getLoginId(), - new SaLoginModel() - .setDevice(deviceType.getDevice()) - .setExtra(LOGIN_USER_KEY, loginUser)); + Set menuPermission = loginUser.getMenuPermission(); + loginUser.setMenuPermission(null); + SaLoginModel model = new SaLoginModel(); + if (ObjectUtil.isNotNull(deviceType)) { + model.setDevice(deviceType.getDevice()); + } + StpUtil.login(loginUser.getLoginId(), model.setExtra(LOGIN_USER_KEY, loginUser)); + // 解决菜单权限过度 token 臃肿过长问题 + StpUtil.getTokenSession().set(MENU_PERMISSION, menuPermission); } /** * 获取用户(多级缓存) */ + @SuppressWarnings("unchecked cast") public static LoginUser getLoginUser() { LoginUser loginUser = (LoginUser) SaHolder.getStorage().get(LOGIN_USER_KEY); if (loginUser != null) { return loginUser; } loginUser = ((JSONObject) StpUtil.getExtra(LOGIN_USER_KEY)).toBean(LoginUser.class); + // 解决菜单权限过度 token 臃肿过长问题 + Set menuPermission = (Set) StpUtil.getTokenSession().get(MENU_PERMISSION); + loginUser.setMenuPermission(menuPermission); SaHolder.getStorage().set(LOGIN_USER_KEY, loginUser); return loginUser; } @@ -72,29 +80,24 @@ public class LoginHelper { /** * 获取用户基于token */ + @SuppressWarnings("unchecked cast") public static LoginUser getLoginUser(String token) { - return ((JSONObject) StpUtil.getExtra(token, LOGIN_USER_KEY)).toBean(LoginUser.class); + LoginUser loginUser = ((JSONObject) StpUtil.getExtra(token, LOGIN_USER_KEY)).toBean(LoginUser.class); + // 解决菜单权限过多 token 臃肿过长问题 + Set menuPermission = (Set) StpUtil.getTokenSessionByToken(token).get(MENU_PERMISSION); + loginUser.setMenuPermission(menuPermission); + return loginUser; } /** * 获取用户id */ public static Long getUserId() { - LoginUser loginUser = getLoginUser(); - if (ObjectUtil.isNull(loginUser)) { - String loginId = StpUtil.getLoginIdAsString(); - String userId = null; - for (UserType value : UserType.values()) { - if (StringUtils.contains(loginId, value.getUserType())) { - String[] strs = StringUtils.split(loginId, JOIN_CODE); - // 用户id在总是在最后 - userId = strs[strs.length - 1]; - } - } - if (StringUtils.isBlank(userId)) { - throw new UtilException("登录用户: LoginId异常 => " + loginId); - } - return Long.parseLong(userId); + LoginUser loginUser; + try { + loginUser = getLoginUser(); + } catch (Exception e) { + return null; } return loginUser.getUserId(); } From edcd7c99ba58e87745741908839b09016a1f4fd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Sat, 18 Feb 2023 23:43:53 +0800 Subject: [PATCH 24/34] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E7=BB=84=E4=BB=B6=20=E6=94=AF=E6=8C=81=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=80=BC=E6=B3=9B=E5=9E=8B=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=A4=9A=E7=A7=8D=E7=B1=BB=E5=9E=8B=E6=95=B0=E6=8D=AE=E7=BF=BB?= =?UTF-8?q?=E8=AF=91(=E4=BE=8B=E5=A6=82:=20=E6=A0=B9=E6=8D=AE=E4=B8=BB?= =?UTF-8?q?=E9=94=AE=E7=BF=BB=E8=AF=91=E6=88=90=E5=AF=B9=E8=B1=A1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/common/translation/TranslationInterface.java | 4 ++-- .../common/translation/handler/TranslationHandler.java | 8 ++++---- .../common/translation/impl/DeptNameTranslationImpl.java | 2 +- .../common/translation/impl/DictTypeTranslationImpl.java | 2 +- .../common/translation/impl/OssUrlTranslationImpl.java | 2 +- .../common/translation/impl/UserNameTranslationImpl.java | 2 +- .../com/ruoyi/framework/config/TranslationConfig.java | 6 +++--- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/translation/TranslationInterface.java b/ruoyi-common/src/main/java/com/ruoyi/common/translation/TranslationInterface.java index 4d59d7ec8..91af97cae 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/translation/TranslationInterface.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/translation/TranslationInterface.java @@ -5,7 +5,7 @@ package com.ruoyi.common.translation; * * @author Lion Li */ -public interface TranslationInterface { +public interface TranslationInterface { /** * 翻译 @@ -13,5 +13,5 @@ public interface TranslationInterface { * @param key 需要被翻译的键(不为空) * @return 返回键对应的值 */ - String translation(Object key, String other); + T translation(Object key, String other); } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/translation/handler/TranslationHandler.java b/ruoyi-common/src/main/java/com/ruoyi/common/translation/handler/TranslationHandler.java index f6daa50c5..ede720675 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/translation/handler/TranslationHandler.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/translation/handler/TranslationHandler.java @@ -29,13 +29,13 @@ public class TranslationHandler extends JsonSerializer implements Contex /** * 全局翻译实现类映射器 */ - public static final Map TRANSLATION_MAPPER = new ConcurrentHashMap<>(); + public static final Map> TRANSLATION_MAPPER = new ConcurrentHashMap<>(); private Translation translation; @Override public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers) throws IOException { - TranslationInterface trans = TRANSLATION_MAPPER.get(translation.type()); + TranslationInterface trans = TRANSLATION_MAPPER.get(translation.type()); if (ObjectUtil.isNotNull(trans)) { // 如果映射字段不为空 则取映射字段的值 if (StringUtils.isNotBlank(translation.mapper())) { @@ -46,8 +46,8 @@ public class TranslationHandler extends JsonSerializer implements Contex gen.writeNull(); return; } - String result = trans.translation(value, translation.other()); - gen.writeString(result); + Object result = trans.translation(value, translation.other()); + gen.writeObject(result); } else { gen.writeObject(value); } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/DeptNameTranslationImpl.java b/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/DeptNameTranslationImpl.java index ed224381d..69196171b 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/DeptNameTranslationImpl.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/DeptNameTranslationImpl.java @@ -15,7 +15,7 @@ import org.springframework.stereotype.Component; @Component @AllArgsConstructor @TranslationType(type = TransConstant.DEPT_ID_TO_NAME) -public class DeptNameTranslationImpl implements TranslationInterface { +public class DeptNameTranslationImpl implements TranslationInterface { private final DeptService deptService; diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/DictTypeTranslationImpl.java b/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/DictTypeTranslationImpl.java index 3928f7d0c..210312c82 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/DictTypeTranslationImpl.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/DictTypeTranslationImpl.java @@ -16,7 +16,7 @@ import org.springframework.stereotype.Component; @Component @AllArgsConstructor @TranslationType(type = TransConstant.DICT_TYPE_TO_LABEL) -public class DictTypeTranslationImpl implements TranslationInterface { +public class DictTypeTranslationImpl implements TranslationInterface { private final DictService dictService; diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/OssUrlTranslationImpl.java b/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/OssUrlTranslationImpl.java index 8b5aa7b3f..69ebd9afe 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/OssUrlTranslationImpl.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/OssUrlTranslationImpl.java @@ -15,7 +15,7 @@ import org.springframework.stereotype.Component; @Component @AllArgsConstructor @TranslationType(type = TransConstant.OSS_ID_TO_URL) -public class OssUrlTranslationImpl implements TranslationInterface { +public class OssUrlTranslationImpl implements TranslationInterface { private final OssService ossService; diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/UserNameTranslationImpl.java b/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/UserNameTranslationImpl.java index bda39b146..36fd6c399 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/UserNameTranslationImpl.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/translation/impl/UserNameTranslationImpl.java @@ -15,7 +15,7 @@ import org.springframework.stereotype.Component; @Component @AllArgsConstructor @TranslationType(type = TransConstant.USER_ID_TO_NAME) -public class UserNameTranslationImpl implements TranslationInterface { +public class UserNameTranslationImpl implements TranslationInterface { private final UserService userService; diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/TranslationConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/TranslationConfig.java index ebed362d3..c68bf6073 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/TranslationConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/TranslationConfig.java @@ -24,15 +24,15 @@ import java.util.Map; public class TranslationConfig { @Autowired - private List list; + private List> list; @Autowired private ObjectMapper objectMapper; @PostConstruct public void init() { - Map map = new HashMap<>(list.size()); - for (TranslationInterface trans : list) { + Map> map = new HashMap<>(list.size()); + for (TranslationInterface trans : list) { if (trans.getClass().isAnnotationPresent(TranslationType.class)) { TranslationType annotation = trans.getClass().getAnnotation(TranslationType.class); map.put(annotation.type(), trans); From f88c93b335dd2741e1dc07263bbda39f9ca732f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Mon, 20 Feb 2023 20:57:55 +0800 Subject: [PATCH 25/34] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20LoginHelper=20?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=20LoginUser=20=E7=BC=BA=E5=A4=B1=E5=AD=90?= =?UTF-8?q?=E7=B1=BB=E6=89=A9=E5=B1=95=E6=95=B0=E6=8D=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/helper/LoginHelper.java | 32 ++++++------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java b/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java index 50220ea30..3b3183bdc 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java @@ -3,8 +3,8 @@ package com.ruoyi.common.helper; import cn.dev33.satoken.context.SaHolder; import cn.dev33.satoken.stp.SaLoginModel; import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.convert.Convert; import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONObject; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.enums.DeviceType; @@ -12,8 +12,6 @@ import com.ruoyi.common.enums.UserType; import lombok.AccessLevel; import lombok.NoArgsConstructor; -import java.util.Set; - /** * 登录鉴权助手 *

@@ -30,7 +28,7 @@ import java.util.Set; public class LoginHelper { public static final String LOGIN_USER_KEY = "loginUser"; - public static final String MENU_PERMISSION = "menuPermission"; + public static final String USER_KEY = "userId"; /** * 登录系统 @@ -49,30 +47,23 @@ public class LoginHelper { */ public static void loginByDevice(LoginUser loginUser, DeviceType deviceType) { SaHolder.getStorage().set(LOGIN_USER_KEY, loginUser); - Set menuPermission = loginUser.getMenuPermission(); - loginUser.setMenuPermission(null); SaLoginModel model = new SaLoginModel(); if (ObjectUtil.isNotNull(deviceType)) { model.setDevice(deviceType.getDevice()); } - StpUtil.login(loginUser.getLoginId(), model.setExtra(LOGIN_USER_KEY, loginUser)); - // 解决菜单权限过度 token 臃肿过长问题 - StpUtil.getTokenSession().set(MENU_PERMISSION, menuPermission); + StpUtil.login(loginUser.getLoginId(), model.setExtra(USER_KEY, loginUser.getUserId())); + StpUtil.getTokenSession().set(LOGIN_USER_KEY, loginUser); } /** * 获取用户(多级缓存) */ - @SuppressWarnings("unchecked cast") public static LoginUser getLoginUser() { LoginUser loginUser = (LoginUser) SaHolder.getStorage().get(LOGIN_USER_KEY); if (loginUser != null) { return loginUser; } - loginUser = ((JSONObject) StpUtil.getExtra(LOGIN_USER_KEY)).toBean(LoginUser.class); - // 解决菜单权限过度 token 臃肿过长问题 - Set menuPermission = (Set) StpUtil.getTokenSession().get(MENU_PERMISSION); - loginUser.setMenuPermission(menuPermission); + loginUser = (LoginUser) StpUtil.getTokenSession().get(LOGIN_USER_KEY); SaHolder.getStorage().set(LOGIN_USER_KEY, loginUser); return loginUser; } @@ -80,26 +71,21 @@ public class LoginHelper { /** * 获取用户基于token */ - @SuppressWarnings("unchecked cast") public static LoginUser getLoginUser(String token) { - LoginUser loginUser = ((JSONObject) StpUtil.getExtra(token, LOGIN_USER_KEY)).toBean(LoginUser.class); - // 解决菜单权限过多 token 臃肿过长问题 - Set menuPermission = (Set) StpUtil.getTokenSessionByToken(token).get(MENU_PERMISSION); - loginUser.setMenuPermission(menuPermission); - return loginUser; + return (LoginUser) StpUtil.getTokenSessionByToken(token).get(LOGIN_USER_KEY); } /** * 获取用户id */ public static Long getUserId() { - LoginUser loginUser; + Long userId; try { - loginUser = getLoginUser(); + userId = Convert.toLong(StpUtil.getExtra(USER_KEY)); } catch (Exception e) { return null; } - return loginUser.getUserId(); + return userId; } /** From 995578c5610418508593534314f2a49bb535116e Mon Sep 17 00:00:00 2001 From: boasad Date: Sun, 26 Feb 2023 12:27:25 +0000 Subject: [PATCH 26/34] =?UTF-8?q?!290=20=E9=99=90=E6=B5=81=E6=B3=A8?= =?UTF-8?q?=E8=A7=A3=E5=92=8C=E5=AE=9E=E7=8E=B0=E7=9A=84=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=20*=20=E9=99=90=E6=B5=81=E6=B3=A8=E8=A7=A3=E7=9A=84=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=B3=A8=E8=A7=A3=E4=BB=A5=E5=8F=8A=E4=BD=BF?= =?UTF-8?q?=E7=94=A8SpringEl=E8=A1=A8=E8=BE=BE=E5=BC=8F=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=AE=9A=E4=B9=89Key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/common/annotation/RateLimiter.java | 8 ++- .../framework/aspectj/RateLimiterAspect.java | 59 ++++++++++++++++--- 2 files changed, 58 insertions(+), 9 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java index 2e3ff7a82..e2693b520 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java @@ -15,7 +15,8 @@ import java.lang.annotation.*; @Documented public @interface RateLimiter { /** - * 限流key + * 限流key,支持使用Spring el表达式来动态获取方法上的参数值 + * 格式类似于 #code.id #{#code} */ String key() default CacheConstants.RATE_LIMIT_KEY; @@ -33,4 +34,9 @@ public @interface RateLimiter { * 限流类型 */ LimitType limitType() default LimitType.DEFAULT; + + /** + * 提示消息 支持国际化 格式为 {code} + */ + String message() default "{rate.limiter.message}"; } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java index 542b16bfd..cc953b1fb 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java @@ -5,6 +5,7 @@ import com.ruoyi.common.enums.LimitType; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.MessageUtils; import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.redis.RedisUtils; import lombok.extern.slf4j.Slf4j; import org.aspectj.lang.JoinPoint; @@ -12,6 +13,14 @@ import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.aspectj.lang.reflect.MethodSignature; import org.redisson.api.RateType; +import org.springframework.core.DefaultParameterNameDiscoverer; +import org.springframework.core.ParameterNameDiscoverer; +import org.springframework.expression.EvaluationContext; +import org.springframework.expression.ExpressionParser; +import org.springframework.expression.ParserContext; +import org.springframework.expression.common.TemplateParserContext; +import org.springframework.expression.spel.standard.SpelExpressionParser; +import org.springframework.expression.spel.support.StandardEvaluationContext; import org.springframework.stereotype.Component; import java.lang.reflect.Method; @@ -26,6 +35,16 @@ import java.lang.reflect.Method; @Component public class RateLimiterAspect { + //定义spel表达式解析器 + private final ExpressionParser parser = new SpelExpressionParser(); + //定义spel解析模版 + private final ParserContext parserContext = new TemplateParserContext(); + //定义spel上下文对象进行解析 + private final EvaluationContext context = new StandardEvaluationContext(); + //方法参数解析器 + private final ParameterNameDiscoverer pnd = new DefaultParameterNameDiscoverer(); + + @Before("@annotation(rateLimiter)") public void doBefore(JoinPoint point, RateLimiter rateLimiter) throws Throwable { int time = rateLimiter.time(); @@ -38,18 +57,45 @@ public class RateLimiterAspect { } long number = RedisUtils.rateLimiter(combineKey, rateType, count, time); if (number == -1) { - throw new ServiceException(MessageUtils.message("rate.limiter.message")); + String message = rateLimiter.message(); + if (StringUtils.startsWith(message, "{") && StringUtils.endsWith(message, "}")) { + message = MessageUtils.message(StringUtils.substring(message, 1, message.length() - 1)); + } + throw new ServiceException(message); } log.info("限制令牌 => {}, 剩余令牌 => {}, 缓存key => '{}'", count, number, combineKey); - } catch (ServiceException e) { - throw e; } catch (Exception e) { - throw new RuntimeException("服务器限流异常,请稍候再试"); + if (e instanceof ServiceException) { + throw e; + } else { + throw new RuntimeException("服务器限流异常,请稍候再试"); + } } } public String getCombineKey(RateLimiter rateLimiter, JoinPoint point) { - StringBuilder stringBuffer = new StringBuilder(rateLimiter.key()); + String key = rateLimiter.key(); + //获取方法(通过方法签名来获取) + MethodSignature signature = (MethodSignature) point.getSignature(); + Method method = signature.getMethod(); + Class targetClass = method.getDeclaringClass(); + //判断是否是spel格式 + if (StringUtils.containsAny(key, "#")) { + //获取参数值 + Object[] args = point.getArgs(); + //获取方法上参数的名称 + String[] parameterNames = pnd.getParameterNames(method); + for (int i = 0; i < parameterNames.length; i++) { + context.setVariable(parameterNames[i], args[i]); + } + //解析返回给key + try { + key = parser.parseExpression(key, parserContext).getValue(context, String.class) + ":"; + } catch (Exception e) { + throw new ServiceException("限流key解析异常!请联系管理员!"); + } + } + StringBuilder stringBuffer = new StringBuilder(key); if (rateLimiter.limitType() == LimitType.IP) { // 获取请求ip stringBuffer.append(ServletUtils.getClientIP()).append("-"); @@ -57,9 +103,6 @@ public class RateLimiterAspect { // 获取客户端实例id stringBuffer.append(RedisUtils.getClient().getId()).append("-"); } - MethodSignature signature = (MethodSignature) point.getSignature(); - Method method = signature.getMethod(); - Class targetClass = method.getDeclaringClass(); stringBuffer.append(targetClass.getName()).append("-").append(method.getName()); return stringBuffer.toString(); } From 2a46cdbd88db7bc0d6b5daa7edb74e14e6a30eb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Sun, 26 Feb 2023 20:39:51 +0800 Subject: [PATCH 27/34] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E9=99=90?= =?UTF-8?q?=E6=B5=81=E5=8A=9F=E8=83=BD=20redis=20key=20=E7=94=9F=E6=88=90?= =?UTF-8?q?=E8=A7=84=E5=88=99=20=E4=BB=A5=E5=8A=9F=E8=83=BD=E5=A4=B4+url+i?= =?UTF-8?q?p+key=E6=A0=BC=E5=BC=8F=20fix=20=E4=BF=AE=E5=A4=8D=20!pr290=20?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/aspectj/RateLimiterAspect.java | 42 ++++++++++++------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java index cc953b1fb..d558a4ce7 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java @@ -1,6 +1,8 @@ package com.ruoyi.framework.aspectj; +import cn.hutool.core.util.ArrayUtil; import com.ruoyi.common.annotation.RateLimiter; +import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.enums.LimitType; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.MessageUtils; @@ -35,16 +37,23 @@ import java.lang.reflect.Method; @Component public class RateLimiterAspect { - //定义spel表达式解析器 + /** + * 定义spel表达式解析器 + */ private final ExpressionParser parser = new SpelExpressionParser(); - //定义spel解析模版 + /** + * 定义spel解析模版 + */ private final ParserContext parserContext = new TemplateParserContext(); - //定义spel上下文对象进行解析 + /** + * 定义spel上下文对象进行解析 + */ private final EvaluationContext context = new StandardEvaluationContext(); - //方法参数解析器 + /** + * 方法参数解析器 + */ private final ParameterNameDiscoverer pnd = new DefaultParameterNameDiscoverer(); - @Before("@annotation(rateLimiter)") public void doBefore(JoinPoint point, RateLimiter rateLimiter) throws Throwable { int time = rateLimiter.time(); @@ -75,35 +84,38 @@ public class RateLimiterAspect { public String getCombineKey(RateLimiter rateLimiter, JoinPoint point) { String key = rateLimiter.key(); - //获取方法(通过方法签名来获取) + // 获取方法(通过方法签名来获取) MethodSignature signature = (MethodSignature) point.getSignature(); Method method = signature.getMethod(); Class targetClass = method.getDeclaringClass(); - //判断是否是spel格式 + // 判断是否是spel格式 if (StringUtils.containsAny(key, "#")) { - //获取参数值 + // 获取参数值 Object[] args = point.getArgs(); - //获取方法上参数的名称 + // 获取方法上参数的名称 String[] parameterNames = pnd.getParameterNames(method); + if (ArrayUtil.isEmpty(parameterNames)) { + throw new ServiceException("限流key解析异常!请联系管理员!"); + } for (int i = 0; i < parameterNames.length; i++) { context.setVariable(parameterNames[i], args[i]); } - //解析返回给key + // 解析返回给key try { key = parser.parseExpression(key, parserContext).getValue(context, String.class) + ":"; } catch (Exception e) { throw new ServiceException("限流key解析异常!请联系管理员!"); } } - StringBuilder stringBuffer = new StringBuilder(key); + StringBuilder stringBuffer = new StringBuilder(CacheConstants.RATE_LIMIT_KEY); + stringBuffer.append(ServletUtils.getRequest().getRequestURI()).append(":"); if (rateLimiter.limitType() == LimitType.IP) { // 获取请求ip - stringBuffer.append(ServletUtils.getClientIP()).append("-"); + stringBuffer.append(ServletUtils.getClientIP()).append(":"); } else if (rateLimiter.limitType() == LimitType.CLUSTER) { // 获取客户端实例id - stringBuffer.append(RedisUtils.getClient().getId()).append("-"); + stringBuffer.append(RedisUtils.getClient().getId()).append(":"); } - stringBuffer.append(targetClass.getName()).append("-").append(method.getName()); - return stringBuffer.toString(); + return stringBuffer.append(key).toString(); } } From 453b8fcbb20fd765be6dc21fcb23f859de25e0c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Sun, 26 Feb 2023 20:44:12 +0800 Subject: [PATCH 28/34] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20=E9=99=90?= =?UTF-8?q?=E6=B5=81=E6=B3=A8=E8=A7=A3=20=E9=BB=98=E8=AE=A4=E4=B8=8D?= =?UTF-8?q?=E5=A1=ABkey=E7=94=9F=E6=88=90=E9=87=8D=E5=A4=8D=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ruoyi/common/annotation/RateLimiter.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java index e2693b520..6eeb2f2c4 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java @@ -1,6 +1,5 @@ package com.ruoyi.common.annotation; -import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.enums.LimitType; import java.lang.annotation.*; @@ -18,7 +17,7 @@ public @interface RateLimiter { * 限流key,支持使用Spring el表达式来动态获取方法上的参数值 * 格式类似于 #code.id #{#code} */ - String key() default CacheConstants.RATE_LIMIT_KEY; + String key() default ""; /** * 限流时间,单位秒 From 7a97377c2827b66c322a240950ed88a2808414a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Tue, 28 Feb 2023 19:16:41 +0800 Subject: [PATCH 29/34] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E5=8F=AA?= =?UTF-8?q?=E6=8B=A6=E6=88=AA=E7=B3=BB=E7=BB=9F=E5=86=85=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E7=9A=84=E8=B7=AF=E5=BE=84=20=E5=87=8F=E5=B0=91=E4=B8=8D?= =?UTF-8?q?=E5=BF=85=E8=A6=81=E7=9A=84=E6=8B=A6=E6=88=AA=E9=80=A0=E6=88=90?= =?UTF-8?q?=E7=9A=84=E6=80=A7=E8=83=BD=E6=B6=88=E8=80=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 4 +- .../ruoyi/framework/config/SaTokenConfig.java | 5 ++- .../framework/handler/AllUrlHandler.java | 43 +++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 ruoyi-framework/src/main/java/com/ruoyi/framework/handler/AllUrlHandler.java diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 1534251f8..d87088d1b 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -128,8 +128,10 @@ security: - /**/*.html - /**/*.css - /**/*.js - # swagger 文档配置 + # 公共路径 - /favicon.ico + - /error + # swagger 文档配置 - /*/api-docs - /*/api-docs/** # actuator 监控配置 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SaTokenConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SaTokenConfig.java index 40eb87c4c..b45eace4b 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SaTokenConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SaTokenConfig.java @@ -7,7 +7,9 @@ import cn.dev33.satoken.router.SaRouter; import cn.dev33.satoken.stp.StpInterface; import cn.dev33.satoken.stp.StpLogic; import cn.dev33.satoken.stp.StpUtil; +import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.framework.config.properties.SecurityProperties; +import com.ruoyi.framework.handler.AllUrlHandler; import com.ruoyi.framework.satoken.dao.PlusSaTokenDao; import com.ruoyi.framework.satoken.service.SaPermissionImpl; import lombok.RequiredArgsConstructor; @@ -36,10 +38,11 @@ public class SaTokenConfig implements WebMvcConfigurer { public void addInterceptors(InterceptorRegistry registry) { // 注册路由拦截器,自定义验证规则 registry.addInterceptor(new SaInterceptor(handler -> { + AllUrlHandler allUrlHandler = SpringUtils.getBean(AllUrlHandler.class); // 登录验证 -- 排除多个路径 SaRouter // 获取所有的 - .match("/**") + .match(allUrlHandler.getUrls()) // 对未排除的路径进行检查 .check(() -> { // 检查是否登录 是否有token diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/handler/AllUrlHandler.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/handler/AllUrlHandler.java new file mode 100644 index 000000000..4ec0919a8 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/handler/AllUrlHandler.java @@ -0,0 +1,43 @@ +package com.ruoyi.framework.handler; + +import cn.hutool.core.util.ReUtil; +import com.ruoyi.common.utils.spring.SpringUtils; +import lombok.Data; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.mvc.method.RequestMappingInfo; +import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.regex.Pattern; + +/** + * 获取所有Url配置 + * + * @author Lion Li + */ +@Data +public class AllUrlHandler implements InitializingBean { + + private static final Pattern PATTERN = Pattern.compile("\\{(.*?)\\}"); + + private List urls = new ArrayList<>(); + + @Override + public void afterPropertiesSet() { + RequestMappingHandlerMapping mapping = SpringUtils.getBean("requestMappingHandlerMapping", RequestMappingHandlerMapping.class); + Map map = mapping.getHandlerMethods(); + map.keySet().forEach(info -> { + // 获取方法上边的注解 替代path variable 为 * + Objects.requireNonNull(info.getPathPatternsCondition().getPatterns()) + .forEach(url -> urls.add(ReUtil.replaceAll(url.getPatternString(), PATTERN, "*"))); + // 获取类上边的注解, 替代path variable 为 * + Objects.requireNonNull(info.getPathPatternsCondition().getPatterns()) + .forEach(url -> urls.add(ReUtil.replaceAll(url.getPatternString(), PATTERN, "*"))); + }); + } + +} From 5464dfb8301048571d0bfd60f8b45ab8bbc355d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Tue, 28 Feb 2023 19:58:19 +0800 Subject: [PATCH 30/34] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E7=B3=BB=E7=BB=9Furl=E5=AD=98=E5=82=A8=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/framework/handler/AllUrlHandler.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/handler/AllUrlHandler.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/handler/AllUrlHandler.java index 4ec0919a8..20b63b2c0 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/handler/AllUrlHandler.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/handler/AllUrlHandler.java @@ -8,10 +8,7 @@ import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.mvc.method.RequestMappingInfo; import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; import java.util.regex.Pattern; /** @@ -28,16 +25,15 @@ public class AllUrlHandler implements InitializingBean { @Override public void afterPropertiesSet() { + Set set = new HashSet<>(); RequestMappingHandlerMapping mapping = SpringUtils.getBean("requestMappingHandlerMapping", RequestMappingHandlerMapping.class); Map map = mapping.getHandlerMethods(); map.keySet().forEach(info -> { - // 获取方法上边的注解 替代path variable 为 * + // 获取注解上边的 path 替代 path variable 为 * Objects.requireNonNull(info.getPathPatternsCondition().getPatterns()) - .forEach(url -> urls.add(ReUtil.replaceAll(url.getPatternString(), PATTERN, "*"))); - // 获取类上边的注解, 替代path variable 为 * - Objects.requireNonNull(info.getPathPatternsCondition().getPatterns()) - .forEach(url -> urls.add(ReUtil.replaceAll(url.getPatternString(), PATTERN, "*"))); + .forEach(url -> set.add(ReUtil.replaceAll(url.getPatternString(), PATTERN, "*"))); }); + urls.addAll(set); } } From 7a5abcd0f82905423eacdc8719e0ae2ce66ea23c Mon Sep 17 00:00:00 2001 From: Evan Wang Date: Thu, 2 Mar 2023 11:07:20 +0800 Subject: [PATCH 31/34] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=85=A8=E9=83=A8url=E5=A4=84=E7=90=86=E5=99=A8=20?= =?UTF-8?q?=E6=9C=AA=E5=8A=A0=E8=BD=BD=E5=88=B0spring=E5=AE=B9=E5=99=A8?= =?UTF-8?q?=E4=B8=AD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/framework/handler/AllUrlHandler.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/handler/AllUrlHandler.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/handler/AllUrlHandler.java index 20b63b2c0..76e5ffdd4 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/handler/AllUrlHandler.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/handler/AllUrlHandler.java @@ -4,6 +4,7 @@ import cn.hutool.core.util.ReUtil; import com.ruoyi.common.utils.spring.SpringUtils; import lombok.Data; import org.springframework.beans.factory.InitializingBean; +import org.springframework.stereotype.Component; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.mvc.method.RequestMappingInfo; import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; @@ -17,6 +18,7 @@ import java.util.regex.Pattern; * @author Lion Li */ @Data +@Component public class AllUrlHandler implements InitializingBean { private static final Pattern PATTERN = Pattern.compile("\\{(.*?)\\}"); From d6c49b915f9428ce4f5da88e73b8c13fbe2f71eb Mon Sep 17 00:00:00 2001 From: Liang Date: Mon, 6 Mar 2023 03:59:59 +0000 Subject: [PATCH 32/34] =?UTF-8?q?!295=20=E6=96=B0=E5=A2=9EEasyExcel?= =?UTF-8?q?=E6=9E=9A=E4=B8=BE=E7=B1=BB=E6=95=B0=E6=8D=AE=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3=20*=20Merge=20remote-tracking=20branch=20'or?= =?UTF-8?q?igin/dev'=20into=20dev=20*=20=E5=88=A9=E7=94=A8ReflectUtil?= =?UTF-8?q?=E5=8F=8D=E5=B0=84=E5=B7=A5=E5=85=B7=E7=B1=BB=E8=8E=B7=E5=8F=96?= =?UTF-8?q?Enum=E5=B1=9E=E6=80=A7=20*=20=E5=88=A9=E7=94=A8ReflectUtil?= =?UTF-8?q?=E5=8F=8D=E5=B0=84=E5=B7=A5=E5=85=B7=E7=B1=BB=E8=8E=B7=E5=8F=96?= =?UTF-8?q?Enum=E5=B1=9E=E6=80=A7=20*=20=E6=96=B0=E5=A2=9EEasyExcel?= =?UTF-8?q?=E6=9E=9A=E4=B8=BE=E7=B1=BB=E6=95=B0=E6=8D=AE=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/annotation/ExcelEnumFormat.java | 30 ++++++++ .../common/convert/ExcelEnumConvert.java | 75 +++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/annotation/ExcelEnumFormat.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/convert/ExcelEnumConvert.java diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/ExcelEnumFormat.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/ExcelEnumFormat.java new file mode 100644 index 000000000..a8f550a4a --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/ExcelEnumFormat.java @@ -0,0 +1,30 @@ +package com.ruoyi.common.annotation; + +import java.lang.annotation.*; + +/** + * 枚举格式化 + * + * @author Liang + */ +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface ExcelEnumFormat { + + /** + * 字典枚举类型 + */ + Class> enumClass(); + + /** + * 字典枚举类中对应的code属性名称,默认为code + */ + String codeField() default "code"; + + /** + * 字典枚举类中对应的text属性名称,默认为text + */ + String textField() default "text"; + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/convert/ExcelEnumConvert.java b/ruoyi-common/src/main/java/com/ruoyi/common/convert/ExcelEnumConvert.java new file mode 100644 index 000000000..c69d90cfb --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/convert/ExcelEnumConvert.java @@ -0,0 +1,75 @@ +package com.ruoyi.common.convert; + +import cn.hutool.core.annotation.AnnotationUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.enums.CellDataTypeEnum; +import com.alibaba.excel.metadata.GlobalConfiguration; +import com.alibaba.excel.metadata.data.ReadCellData; +import com.alibaba.excel.metadata.data.WriteCellData; +import com.alibaba.excel.metadata.property.ExcelContentProperty; +import com.ruoyi.common.annotation.ExcelEnumFormat; +import com.ruoyi.common.utils.reflect.ReflectUtils; +import lombok.extern.slf4j.Slf4j; + +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.Map; + +/** + * 枚举格式化转换处理 + * + * @author Liang + */ +@Slf4j +public class ExcelEnumConvert implements Converter { + + @Override + public Class supportJavaTypeKey() { + return Object.class; + } + + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return null; + } + + @Override + public Object convertToJavaData(ReadCellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + Object codeValue = cellData.getData(); + // 如果是空值 + if (ObjectUtil.isNull(codeValue)) { + return null; + } + Map enumValueMap = beforeConvert(contentProperty); + String textValue = enumValueMap.get(codeValue); + return Convert.convert(contentProperty.getField().getType(), textValue); + } + + @Override + public WriteCellData convertToExcelData(Object object, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + if (ObjectUtil.isNull(object)) { + return new WriteCellData<>(""); + } + Map enumValueMap = beforeConvert(contentProperty); + String value = Convert.toStr(enumValueMap.get(object), ""); + return new WriteCellData<>(value); + } + + private Map beforeConvert(ExcelContentProperty contentProperty) { + ExcelEnumFormat anno = getAnnotation(contentProperty.getField()); + Map enumValueMap = new HashMap<>(); + Enum[] enumConstants = anno.enumClass().getEnumConstants(); + for (Enum enumConstant : enumConstants) { + Object codeValue = ReflectUtils.invokeGetter(enumConstant, anno.codeField()); + String textValue = ReflectUtils.invokeGetter(enumConstant, anno.textField()); + enumValueMap.put(codeValue, textValue); + } + return enumValueMap; + } + + private ExcelEnumFormat getAnnotation(Field field) { + return AnnotationUtil.getAnnotation(field, ExcelEnumFormat.class); + } +} From 31194414ebc6d1430ac74b83f72f0b3344d3c372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Tue, 7 Mar 2023 12:20:14 +0800 Subject: [PATCH 33/34] =?UTF-8?q?update=20=E5=90=8C=E6=AD=A5=20ruoyi=20*?= =?UTF-8?q?=20update=20element-ui=202.15.10=20=3D>=202.15.12=20*=20update?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=20tagsView=E5=8F=B3=E9=80=89=E6=A1=86?= =?UTF-8?q?=EF=BC=8C=E9=A6=96=E9=A1=B5=E4=B8=8D=E5=BA=94=E8=AF=A5=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E5=85=B3=E9=97=AD=E5=B7=A6=E4=BE=A7=E9=80=89=E9=A1=B9?= =?UTF-8?q?=20*=20update=20copyright=202023=20*=20update=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20=E7=9B=91=E6=8E=A7=E9=A1=B5=E9=9D=A2=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E6=98=BE=E7=A4=BA=20*=20update=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20=E6=97=A5=E5=BF=97=E6=B3=A8=E8=A7=A3=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=8E=92=E9=99=A4=E6=8C=87=E5=AE=9A=E7=9A=84=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E5=8F=82=E6=95=B0=20*=20update=20=E4=BC=98=E5=8C=96=20?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E6=A0=A1=E9=AA=8C=E4=BC=98=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=20*=20fix=20=E4=BF=AE=E5=A4=8D=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8B=E8=BD=BD=E5=87=BA=E7=8E=B0=E7=9A=84?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=20*=20fix=20=E4=BF=AE=E5=A4=8D=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=AF=86=E7=A0=81=E6=97=A5=E5=BF=97=E5=AD=98=E5=82=A8?= =?UTF-8?q?=E6=98=8E=E6=96=87=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/SysConfigController.java | 4 ++-- .../controller/system/SysDeptController.java | 4 ++-- .../system/SysDictTypeController.java | 4 ++-- .../controller/system/SysMenuController.java | 4 ++-- .../controller/system/SysPostController.java | 8 +++---- .../system/SysProfileController.java | 6 ++---- .../controller/system/SysRoleController.java | 8 +++---- .../controller/system/SysUserController.java | 16 ++++++-------- .../java/com/ruoyi/common/annotation/Log.java | 6 ++++++ .../ruoyi/framework/aspectj/LogAspect.java | 15 +++++++------ .../system/service/ISysConfigService.java | 2 +- .../ruoyi/system/service/ISysDeptService.java | 2 +- .../system/service/ISysDictTypeService.java | 2 +- .../ruoyi/system/service/ISysMenuService.java | 2 +- .../ruoyi/system/service/ISysPostService.java | 4 ++-- .../ruoyi/system/service/ISysRoleService.java | 4 ++-- .../ruoyi/system/service/ISysUserService.java | 6 +++--- .../system/service/SysRegisterService.java | 2 +- .../service/impl/SysConfigServiceImpl.java | 6 +++--- .../service/impl/SysDeptServiceImpl.java | 7 ++----- .../service/impl/SysDictTypeServiceImpl.java | 7 ++----- .../service/impl/SysMenuServiceImpl.java | 9 +++----- .../service/impl/SysOssConfigServiceImpl.java | 10 ++++----- .../service/impl/SysPostServiceImpl.java | 15 ++++--------- .../service/impl/SysRoleServiceImpl.java | 14 ++++--------- .../service/impl/SysUserServiceImpl.java | 21 ++++++------------- ruoyi-ui/package.json | 2 +- .../src/layout/components/TagsView/index.vue | 2 +- ruoyi-ui/src/permission.js | 2 +- ruoyi-ui/src/plugins/download.js | 12 +++++------ ruoyi-ui/src/utils/request.js | 6 +++--- ruoyi-ui/src/utils/ruoyi.js | 10 ++------- ruoyi-ui/src/views/login.vue | 2 +- ruoyi-ui/src/views/monitor/cache/index.vue | 8 +++---- ruoyi-ui/src/views/monitor/cache/list.vue | 6 +++--- ruoyi-ui/src/views/register.vue | 2 +- ruoyi-ui/src/views/system/config/index.vue | 2 +- 37 files changed, 102 insertions(+), 140 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java index c1b3acd86..f5cb2a5ee 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java @@ -79,7 +79,7 @@ public class SysConfigController extends BaseController { @Log(title = "参数管理", businessType = BusinessType.INSERT) @PostMapping public R add(@Validated @RequestBody SysConfig config) { - if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) { + if (!configService.checkConfigKeyUnique(config)) { return R.fail("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); } configService.insertConfig(config); @@ -93,7 +93,7 @@ public class SysConfigController extends BaseController { @Log(title = "参数管理", businessType = BusinessType.UPDATE) @PutMapping public R edit(@Validated @RequestBody SysConfig config) { - if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) { + if (!configService.checkConfigKeyUnique(config)) { return R.fail("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); } configService.updateConfig(config); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java index 2acacbe8b..512c644c4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java @@ -72,7 +72,7 @@ public class SysDeptController extends BaseController { @Log(title = "部门管理", businessType = BusinessType.INSERT) @PostMapping public R add(@Validated @RequestBody SysDept dept) { - if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) { + if (!deptService.checkDeptNameUnique(dept)) { return R.fail("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); } return toAjax(deptService.insertDept(dept)); @@ -87,7 +87,7 @@ public class SysDeptController extends BaseController { public R edit(@Validated @RequestBody SysDept dept) { Long deptId = dept.getDeptId(); deptService.checkDeptDataScope(deptId); - if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) { + if (!deptService.checkDeptNameUnique(dept)) { return R.fail("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); } else if (dept.getParentId().equals(deptId)) { return R.fail("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己"); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java index 86840b7a5..e6beb64ab 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java @@ -69,7 +69,7 @@ public class SysDictTypeController extends BaseController { @Log(title = "字典类型", businessType = BusinessType.INSERT) @PostMapping public R add(@Validated @RequestBody SysDictType dict) { - if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) { + if (!dictTypeService.checkDictTypeUnique(dict)) { return R.fail("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); } dictTypeService.insertDictType(dict); @@ -83,7 +83,7 @@ public class SysDictTypeController extends BaseController { @Log(title = "字典类型", businessType = BusinessType.UPDATE) @PutMapping public R edit(@Validated @RequestBody SysDictType dict) { - if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) { + if (!dictTypeService.checkDictTypeUnique(dict)) { return R.fail("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); } dictTypeService.updateDictType(dict); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java index e80f0ee7c..1f1386156 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java @@ -82,7 +82,7 @@ public class SysMenuController extends BaseController { @Log(title = "菜单管理", businessType = BusinessType.INSERT) @PostMapping public R add(@Validated @RequestBody SysMenu menu) { - if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) { + if (!menuService.checkMenuNameUnique(menu)) { return R.fail("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); } else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) { return R.fail("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); @@ -97,7 +97,7 @@ public class SysMenuController extends BaseController { @Log(title = "菜单管理", businessType = BusinessType.UPDATE) @PutMapping public R edit(@Validated @RequestBody SysMenu menu) { - if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) { + if (!menuService.checkMenuNameUnique(menu)) { return R.fail("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); } else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) { return R.fail("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java index 656987776..4036364fa 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java @@ -69,9 +69,9 @@ public class SysPostController extends BaseController { @Log(title = "岗位管理", businessType = BusinessType.INSERT) @PostMapping public R add(@Validated @RequestBody SysPost post) { - if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) { + if (!postService.checkPostNameUnique(post)) { return R.fail("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在"); - } else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) { + } else if (!postService.checkPostCodeUnique(post)) { return R.fail("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在"); } return toAjax(postService.insertPost(post)); @@ -84,9 +84,9 @@ public class SysPostController extends BaseController { @Log(title = "岗位管理", businessType = BusinessType.UPDATE) @PutMapping public R edit(@Validated @RequestBody SysPost post) { - if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) { + if (!postService.checkPostNameUnique(post)) { return R.fail("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在"); - } else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) { + } else if (!postService.checkPostCodeUnique(post)) { return R.fail("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在"); } return toAjax(postService.updatePost(post)); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java index 77a8767de..9e646ec2c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java @@ -58,12 +58,10 @@ public class SysProfileController extends BaseController { @Log(title = "个人信息", businessType = BusinessType.UPDATE) @PutMapping public R updateProfile(@RequestBody SysUser user) { - if (StringUtils.isNotEmpty(user.getPhonenumber()) - && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) { + if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { return R.fail("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); } - if (StringUtils.isNotEmpty(user.getEmail()) - && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) { + if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { return R.fail("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); } user.setUserId(getUserId()); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java index f88c5ed4e..47e157512 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java @@ -87,9 +87,9 @@ public class SysRoleController extends BaseController { @Log(title = "角色管理", businessType = BusinessType.INSERT) @PostMapping public R add(@Validated @RequestBody SysRole role) { - if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) { + if (!roleService.checkRoleNameUnique(role)) { return R.fail("新增角色'" + role.getRoleName() + "'失败,角色名称已存在"); - } else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) { + } else if (!roleService.checkRoleKeyUnique(role)) { return R.fail("新增角色'" + role.getRoleName() + "'失败,角色权限已存在"); } return toAjax(roleService.insertRole(role)); @@ -105,9 +105,9 @@ public class SysRoleController extends BaseController { public R edit(@Validated @RequestBody SysRole role) { roleService.checkRoleAllowed(role); roleService.checkRoleDataScope(role.getRoleId()); - if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) { + if (!roleService.checkRoleNameUnique(role)) { return R.fail("修改角色'" + role.getRoleName() + "'失败,角色名称已存在"); - } else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) { + } else if (!roleService.checkRoleKeyUnique(role)) { return R.fail("修改角色'" + role.getRoleName() + "'失败,角色权限已存在"); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java index 7e358d511..0b91c50b9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java @@ -136,13 +136,11 @@ public class SysUserController extends BaseController { @Log(title = "用户管理", businessType = BusinessType.INSERT) @PostMapping public R add(@Validated @RequestBody SysUser user) { - if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user))) { + if (!userService.checkUserNameUnique(user)) { return R.fail("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); - } else if (StringUtils.isNotEmpty(user.getPhonenumber()) - && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) { + } else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { return R.fail("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); - } else if (StringUtils.isNotEmpty(user.getEmail()) - && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) { + } else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { return R.fail("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在"); } user.setPassword(BCrypt.hashpw(user.getPassword())); @@ -158,13 +156,11 @@ public class SysUserController extends BaseController { public R edit(@Validated @RequestBody SysUser user) { userService.checkUserAllowed(user); userService.checkUserDataScope(user.getUserId()); - if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user))) { + if (!userService.checkUserNameUnique(user)) { return R.fail("修改用户'" + user.getUserName() + "'失败,登录账号已存在"); - } else if (StringUtils.isNotEmpty(user.getPhonenumber()) - && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) { + } else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { return R.fail("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); - } else if (StringUtils.isNotEmpty(user.getEmail()) - && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) { + } else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { return R.fail("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); } return toAjax(userService.updateUser(user)); diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java index 32c39a3b0..f9ba00126 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java @@ -38,4 +38,10 @@ public @interface Log { * 是否保存响应的参数 */ boolean isSaveResponseData() default true; + + /** + * 排除指定的请求参数 + */ + String[] excludeParamNames() default {}; + } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java index 64ab736a6..00918327b 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java @@ -112,7 +112,7 @@ public class LogAspect { // 是否需要保存request,参数和值 if (log.isSaveRequestData()) { // 获取参数的信息,传入到数据库中。 - setRequestValue(joinPoint, operLog); + setRequestValue(joinPoint, operLog, log.excludeParamNames()); } // 是否需要保存response,参数和值 if (log.isSaveResponseData() && ObjectUtil.isNotNull(jsonResult)) { @@ -126,14 +126,16 @@ public class LogAspect { * @param operLog 操作日志 * @throws Exception 异常 */ - private void setRequestValue(JoinPoint joinPoint, OperLogEvent operLog) throws Exception { + private void setRequestValue(JoinPoint joinPoint, OperLogEvent operLog, String[] excludeParamNames) throws Exception { + Map paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest()); String requestMethod = operLog.getRequestMethod(); - if (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)) { - String params = argsArrayToString(joinPoint.getArgs()); + if (MapUtil.isEmpty(paramsMap) + && HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)) { + String params = argsArrayToString(joinPoint.getArgs(), excludeParamNames); operLog.setOperParam(StringUtils.substring(params, 0, 2000)); } else { - Map paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest()); MapUtil.removeAny(paramsMap, EXCLUDE_PROPERTIES); + MapUtil.removeAny(paramsMap, excludeParamNames); operLog.setOperParam(StringUtils.substring(JsonUtils.toJsonString(paramsMap), 0, 2000)); } } @@ -141,7 +143,7 @@ public class LogAspect { /** * 参数拼装 */ - private String argsArrayToString(Object[] paramsArray) { + private String argsArrayToString(Object[] paramsArray, String[] excludeParamNames) { StringBuilder params = new StringBuilder(); if (paramsArray != null && paramsArray.length > 0) { for (Object o : paramsArray) { @@ -151,6 +153,7 @@ public class LogAspect { Dict dict = JsonUtils.parseMap(str); if (MapUtil.isNotEmpty(dict)) { MapUtil.removeAny(dict, EXCLUDE_PROPERTIES); + MapUtil.removeAny(dict, excludeParamNames); str = JsonUtils.toJsonString(dict); } params.append(str).append(" "); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java index adcb5d3f7..d6bd54f64 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java @@ -91,6 +91,6 @@ public interface ISysConfigService { * @param config 参数信息 * @return 结果 */ - String checkConfigKeyUnique(SysConfig config); + boolean checkConfigKeyUnique(SysConfig config); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java index d821a4ab3..4ae34ab20 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java @@ -81,7 +81,7 @@ public interface ISysDeptService { * @param dept 部门信息 * @return 结果 */ - String checkDeptNameUnique(SysDept dept); + boolean checkDeptNameUnique(SysDept dept); /** * 校验部门是否有数据权限 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java index 1bad68089..0e3d94dab 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java @@ -100,5 +100,5 @@ public interface ISysDictTypeService { * @param dictType 字典类型 * @return 结果 */ - String checkDictTypeUnique(SysDictType dictType); + boolean checkDictTypeUnique(SysDictType dictType); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java index 813b1e282..906cd88b4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java @@ -133,5 +133,5 @@ public interface ISysMenuService { * @param menu 菜单信息 * @return 结果 */ - String checkMenuNameUnique(SysMenu menu); + boolean checkMenuNameUnique(SysMenu menu); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java index 9c3b78cd7..42968e953 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java @@ -53,7 +53,7 @@ public interface ISysPostService { * @param post 岗位信息 * @return 结果 */ - String checkPostNameUnique(SysPost post); + boolean checkPostNameUnique(SysPost post); /** * 校验岗位编码 @@ -61,7 +61,7 @@ public interface ISysPostService { * @param post 岗位信息 * @return 结果 */ - String checkPostCodeUnique(SysPost post); + boolean checkPostCodeUnique(SysPost post); /** * 通过岗位ID查询岗位使用数量 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java index 5b726b2e0..107ccf262 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java @@ -71,7 +71,7 @@ public interface ISysRoleService { * @param role 角色信息 * @return 结果 */ - String checkRoleNameUnique(SysRole role); + boolean checkRoleNameUnique(SysRole role); /** * 校验角色权限是否唯一 @@ -79,7 +79,7 @@ public interface ISysRoleService { * @param role 角色信息 * @return 结果 */ - String checkRoleKeyUnique(SysRole role); + boolean checkRoleKeyUnique(SysRole role); /** * 校验角色是否允许操作 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java index 042efc2c9..cfa6e16f9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java @@ -86,7 +86,7 @@ public interface ISysUserService { * @param user 用户信息 * @return 结果 */ - String checkUserNameUnique(SysUser user); + boolean checkUserNameUnique(SysUser user); /** * 校验手机号码是否唯一 @@ -94,7 +94,7 @@ public interface ISysUserService { * @param user 用户信息 * @return 结果 */ - String checkPhoneUnique(SysUser user); + boolean checkPhoneUnique(SysUser user); /** * 校验email是否唯一 @@ -102,7 +102,7 @@ public interface ISysUserService { * @param user 用户信息 * @return 结果 */ - String checkEmailUnique(SysUser user); + boolean checkEmailUnique(SysUser user); /** * 校验用户是否允许操作 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java index bf9d00d4d..886aec3b8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java @@ -54,7 +54,7 @@ public class SysRegisterService { sysUser.setPassword(BCrypt.hashpw(password)); sysUser.setUserType(userType); - if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(sysUser))) { + if (!userService.checkUserNameUnique(sysUser)) { throw new UserException("user.register.save.error", username); } boolean regFlag = userService.registerUser(sysUser); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java index c77612e72..932753b26 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java @@ -204,13 +204,13 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService { * @return 结果 */ @Override - public String checkConfigKeyUnique(SysConfig config) { + public boolean checkConfigKeyUnique(SysConfig config) { long configId = ObjectUtil.isNull(config.getConfigId()) ? -1L : config.getConfigId(); SysConfig info = baseMapper.selectOne(new LambdaQueryWrapper().eq(SysConfig::getConfigKey, config.getConfigKey())); if (ObjectUtil.isNotNull(info) && info.getConfigId() != configId) { - return UserConstants.NOT_UNIQUE; + return false; } - return UserConstants.UNIQUE; + return true; } /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index 0e8894d7d..8af6cabdb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -187,15 +187,12 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService { * @return 结果 */ @Override - public String checkDeptNameUnique(SysDept dept) { + public boolean checkDeptNameUnique(SysDept dept) { boolean exist = baseMapper.exists(new LambdaQueryWrapper() .eq(SysDept::getDeptName, dept.getDeptName()) .eq(SysDept::getParentId, dept.getParentId()) .ne(ObjectUtil.isNotNull(dept.getDeptId()), SysDept::getDeptId, dept.getDeptId())); - if (exist) { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; + return !exist; } /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java index d7244116a..0c897df61 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java @@ -216,14 +216,11 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService * @return 结果 */ @Override - public String checkDictTypeUnique(SysDictType dict) { + public boolean checkDictTypeUnique(SysDictType dict) { boolean exist = baseMapper.exists(new LambdaQueryWrapper() .eq(SysDictType::getDictType, dict.getDictType()) .ne(ObjectUtil.isNotNull(dict.getDictId()), SysDictType::getDictId, dict.getDictId())); - if (exist) { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; + return !exist; } /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java index 83cf2d13a..8e3fad9f4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java @@ -163,7 +163,7 @@ public class SysMenuServiceImpl implements ISysMenuService { router.setQuery(menu.getQueryParam()); router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath())); List cMenus = menu.getChildren(); - if (!cMenus.isEmpty() && UserConstants.TYPE_DIR.equals(menu.getMenuType())) { + if (CollUtil.isNotEmpty(cMenus) && UserConstants.TYPE_DIR.equals(menu.getMenuType())) { router.setAlwaysShow(true); router.setRedirect("noRedirect"); router.setChildren(buildMenus(cMenus)); @@ -287,15 +287,12 @@ public class SysMenuServiceImpl implements ISysMenuService { * @return 结果 */ @Override - public String checkMenuNameUnique(SysMenu menu) { + public boolean checkMenuNameUnique(SysMenu menu) { boolean exist = baseMapper.exists(new LambdaQueryWrapper() .eq(SysMenu::getMenuName, menu.getMenuName()) .eq(SysMenu::getParentId, menu.getParentId()) .ne(ObjectUtil.isNotNull(menu.getMenuId()), SysMenu::getMenuId, menu.getMenuId())); - if (exist) { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; + return !exist; } /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssConfigServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssConfigServiceImpl.java index b43908434..2e90e50f6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssConfigServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssConfigServiceImpl.java @@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.constant.CacheNames; -import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.PageQuery; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.exception.ServiceException; @@ -113,8 +112,7 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService { * 保存前的数据校验 */ private void validEntityBeforeSave(SysOssConfig entity) { - if (StringUtils.isNotEmpty(entity.getConfigKey()) - && UserConstants.NOT_UNIQUE.equals(checkConfigKeyUnique(entity))) { + if (StringUtils.isNotEmpty(entity.getConfigKey()) && !checkConfigKeyUnique(entity)) { throw new ServiceException("操作配置'" + entity.getConfigKey() + "'失败, 配置key已存在!"); } } @@ -142,15 +140,15 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService { /** * 判断configKey是否唯一 */ - private String checkConfigKeyUnique(SysOssConfig sysOssConfig) { + private boolean checkConfigKeyUnique(SysOssConfig sysOssConfig) { long ossConfigId = ObjectUtil.isNull(sysOssConfig.getOssConfigId()) ? -1L : sysOssConfig.getOssConfigId(); SysOssConfig info = baseMapper.selectOne(new LambdaQueryWrapper() .select(SysOssConfig::getOssConfigId, SysOssConfig::getConfigKey) .eq(SysOssConfig::getConfigKey, sysOssConfig.getConfigKey())); if (ObjectUtil.isNotNull(info) && info.getOssConfigId() != ossConfigId) { - return UserConstants.NOT_UNIQUE; + return false; } - return UserConstants.UNIQUE; + return true; } /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java index 7e2a56c2b..79edef7f9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java @@ -3,7 +3,6 @@ package com.ruoyi.system.service.impl; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.PageQuery; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.exception.ServiceException; @@ -94,14 +93,11 @@ public class SysPostServiceImpl implements ISysPostService { * @return 结果 */ @Override - public String checkPostNameUnique(SysPost post) { + public boolean checkPostNameUnique(SysPost post) { boolean exist = baseMapper.exists(new LambdaQueryWrapper() .eq(SysPost::getPostName, post.getPostName()) .ne(ObjectUtil.isNotNull(post.getPostId()), SysPost::getPostId, post.getPostId())); - if (exist) { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; + return !exist; } /** @@ -111,14 +107,11 @@ public class SysPostServiceImpl implements ISysPostService { * @return 结果 */ @Override - public String checkPostCodeUnique(SysPost post) { + public boolean checkPostCodeUnique(SysPost post) { boolean exist = baseMapper.exists(new LambdaQueryWrapper() .eq(SysPost::getPostCode, post.getPostCode()) .ne(ObjectUtil.isNotNull(post.getPostId()), SysPost::getPostId, post.getPostId())); - if (exist) { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; + return !exist; } /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java index 35bae606a..eb2a6df2a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java @@ -152,14 +152,11 @@ public class SysRoleServiceImpl implements ISysRoleService { * @return 结果 */ @Override - public String checkRoleNameUnique(SysRole role) { + public boolean checkRoleNameUnique(SysRole role) { boolean exist = baseMapper.exists(new LambdaQueryWrapper() .eq(SysRole::getRoleName, role.getRoleName()) .ne(ObjectUtil.isNotNull(role.getRoleId()), SysRole::getRoleId, role.getRoleId())); - if (exist) { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; + return !exist; } /** @@ -169,14 +166,11 @@ public class SysRoleServiceImpl implements ISysRoleService { * @return 结果 */ @Override - public String checkRoleKeyUnique(SysRole role) { + public boolean checkRoleKeyUnique(SysRole role) { boolean exist = baseMapper.exists(new LambdaQueryWrapper() .eq(SysRole::getRoleKey, role.getRoleKey()) .ne(ObjectUtil.isNotNull(role.getRoleId()), SysRole::getRoleId, role.getRoleId())); - if (exist) { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; + return !exist; } /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java index 8def3ff12..b4105870c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -199,14 +199,11 @@ public class SysUserServiceImpl implements ISysUserService, UserService { * @return 结果 */ @Override - public String checkUserNameUnique(SysUser user) { + public boolean checkUserNameUnique(SysUser user) { boolean exist = baseMapper.exists(new LambdaQueryWrapper() .eq(SysUser::getUserName, user.getUserName()) .ne(ObjectUtil.isNotNull(user.getUserId()), SysUser::getUserId, user.getUserId())); - if (exist) { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; + return !exist; } /** @@ -215,14 +212,11 @@ public class SysUserServiceImpl implements ISysUserService, UserService { * @param user 用户信息 */ @Override - public String checkPhoneUnique(SysUser user) { + public boolean checkPhoneUnique(SysUser user) { boolean exist = baseMapper.exists(new LambdaQueryWrapper() .eq(SysUser::getPhonenumber, user.getPhonenumber()) .ne(ObjectUtil.isNotNull(user.getUserId()), SysUser::getUserId, user.getUserId())); - if (exist) { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; + return !exist; } /** @@ -231,14 +225,11 @@ public class SysUserServiceImpl implements ISysUserService, UserService { * @param user 用户信息 */ @Override - public String checkEmailUnique(SysUser user) { + public boolean checkEmailUnique(SysUser user) { boolean exist = baseMapper.exists(new LambdaQueryWrapper() .eq(SysUser::getEmail, user.getEmail()) .ne(ObjectUtil.isNotNull(user.getUserId()), SysUser::getUserId, user.getUserId())); - if (exist) { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; + return !exist; } /** diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index c1975834f..e47699e4a 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -40,7 +40,7 @@ "clipboard": "2.0.8", "core-js": "3.25.3", "echarts": "5.4.0", - "element-ui": "2.15.10", + "element-ui": "2.15.12", "file-saver": "2.0.5", "fuse.js": "6.4.3", "highlight.js": "9.18.5", diff --git a/ruoyi-ui/src/layout/components/TagsView/index.vue b/ruoyi-ui/src/layout/components/TagsView/index.vue index cc980717e..3c0644e1c 100644 --- a/ruoyi-ui/src/layout/components/TagsView/index.vue +++ b/ruoyi-ui/src/layout/components/TagsView/index.vue @@ -87,7 +87,7 @@ export default { }, isFirstView() { try { - return this.selectedTag.fullPath === this.visitedViews[1].fullPath || this.selectedTag.fullPath === '/index' + return this.selectedTag.fullPath === '/index' || this.selectedTag.fullPath === this.visitedViews[1].fullPath } catch (err) { return false } diff --git a/ruoyi-ui/src/permission.js b/ruoyi-ui/src/permission.js index 6bb0a1f83..609d21590 100644 --- a/ruoyi-ui/src/permission.js +++ b/ruoyi-ui/src/permission.js @@ -8,7 +8,7 @@ import { isRelogin } from '@/utils/request' NProgress.configure({ showSpinner: false }) -const whiteList = ['/login', '/auth-redirect', '/bind', '/register'] +const whiteList = ['/login', '/register'] router.beforeEach((to, from, next) => { NProgress.start() diff --git a/ruoyi-ui/src/plugins/download.js b/ruoyi-ui/src/plugins/download.js index a1b21dad9..b27702f18 100644 --- a/ruoyi-ui/src/plugins/download.js +++ b/ruoyi-ui/src/plugins/download.js @@ -17,9 +17,9 @@ export default { url: url, responseType: 'blob', headers: { 'Authorization': 'Bearer ' + getToken() } - }).then(async (res) => { - const isLogin = await blobValidate(res.data); - if (isLogin) { + }).then((res) => { + const isBlob = blobValidate(res.data); + if (isBlob) { const blob = new Blob([res.data], { type: 'application/octet-stream' }) this.saveAs(blob, decodeURIComponent(res.headers['download-filename'])) } else { @@ -42,9 +42,9 @@ export default { 'Authorization': 'Bearer ' + getToken(), 'datasource': localStorage.getItem("dataName") } - }).then(async (res) => { - const isLogin = await blobValidate(res.data); - if (isLogin) { + }).then((res) => { + const isBlob = blobValidate(res.data); + if (isBlob) { const blob = new Blob([res.data], { type: 'application/zip' }) this.saveAs(blob, name) } else { diff --git a/ruoyi-ui/src/utils/request.js b/ruoyi-ui/src/utils/request.js index f94fa0e5e..850685cd6 100644 --- a/ruoyi-ui/src/utils/request.js +++ b/ruoyi-ui/src/utils/request.js @@ -74,7 +74,7 @@ service.interceptors.response.use(res => { // 获取错误信息 const msg = errorCode[code] || res.data.msg || errorCode['default'] // 二进制数据则直接返回 - if(res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer'){ + if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') { return res.data } if (code === 401) { @@ -127,8 +127,8 @@ export function download(url, params, filename, config) { responseType: 'blob', ...config }).then(async (data) => { - const isLogin = await blobValidate(data); - if (isLogin) { + const isBlob = blobValidate(data); + if (isBlob) { const blob = new Blob([data]) saveAs(blob, filename) } else { diff --git a/ruoyi-ui/src/utils/ruoyi.js b/ruoyi-ui/src/utils/ruoyi.js index 243c4c7b1..44bf9c403 100644 --- a/ruoyi-ui/src/utils/ruoyi.js +++ b/ruoyi-ui/src/utils/ruoyi.js @@ -228,12 +228,6 @@ export function tansParams(params) { } // 验证是否为blob格式 -export async function blobValidate(data) { - try { - const text = await data.text(); - JSON.parse(text); - return false; - } catch (error) { - return true; - } +export function blobValidate(data) { + return data.type !== 'application/json' } diff --git a/ruoyi-ui/src/views/login.vue b/ruoyi-ui/src/views/login.vue index ed8d971a2..0ddb13443 100644 --- a/ruoyi-ui/src/views/login.vue +++ b/ruoyi-ui/src/views/login.vue @@ -56,7 +56,7 @@ diff --git a/ruoyi-ui/src/views/monitor/cache/index.vue b/ruoyi-ui/src/views/monitor/cache/index.vue index 53f6eee51..e81da2e8f 100644 --- a/ruoyi-ui/src/views/monitor/cache/index.vue +++ b/ruoyi-ui/src/views/monitor/cache/index.vue @@ -3,7 +3,7 @@ -
基本信息
+
基本信息
@@ -45,7 +45,7 @@ -
命令统计
+
命令统计
@@ -54,9 +54,7 @@ -
- 内存信息 -
+
内存信息
diff --git a/ruoyi-ui/src/views/monitor/cache/list.vue b/ruoyi-ui/src/views/monitor/cache/list.vue index 94307ab6a..8073d56a7 100644 --- a/ruoyi-ui/src/views/monitor/cache/list.vue +++ b/ruoyi-ui/src/views/monitor/cache/list.vue @@ -4,7 +4,7 @@
- 缓存列表 + 缓存列表
- 键名列表 + 键名列表
- 缓存内容 + 缓存内容
diff --git a/ruoyi-ui/src/views/system/config/index.vue b/ruoyi-ui/src/views/system/config/index.vue index f580b983e..3ab81fc20 100644 --- a/ruoyi-ui/src/views/system/config/index.vue +++ b/ruoyi-ui/src/views/system/config/index.vue @@ -107,7 +107,7 @@ - +