diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java index 6f8a5574..85179888 100644 --- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java @@ -56,8 +56,8 @@ public class SysUser extends BaseEntity /** 密码 */ private String password; - /** 帐号状态(0正常 1停用) */ - @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用") + /** 账号状态(0正常 1停用) */ + @Excel(name = "账号状态", readConverterExp = "0=正常,1=停用") private String status; /** 删除标志(0代表存在 2代表删除) */ @@ -297,6 +297,7 @@ public class SysUser extends BaseEntity { this.roleId = roleId; } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/CacheRequestFilter.java b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/CacheRequestFilter.java deleted file mode 100644 index 94c6cb56..00000000 --- a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/CacheRequestFilter.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.ruoyi.gateway.filter; - -import java.util.Collections; -import java.util.List; -import org.springframework.cloud.gateway.filter.GatewayFilter; -import org.springframework.cloud.gateway.filter.GatewayFilterChain; -import org.springframework.cloud.gateway.filter.OrderedGatewayFilter; -import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory; -import org.springframework.cloud.gateway.support.ServerWebExchangeUtils; -import org.springframework.http.HttpMethod; -import org.springframework.stereotype.Component; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Mono; - -/** - * 获取body请求数据(解决流不能重复读取问题) - * - * @author ruoyi - */ -@Component -public class CacheRequestFilter extends AbstractGatewayFilterFactory -{ - public CacheRequestFilter() - { - super(Config.class); - } - - @Override - public String name() - { - return "CacheRequestFilter"; - } - - @Override - public GatewayFilter apply(Config config) - { - CacheRequestGatewayFilter cacheRequestGatewayFilter = new CacheRequestGatewayFilter(); - Integer order = config.getOrder(); - if (order == null) - { - return cacheRequestGatewayFilter; - } - return new OrderedGatewayFilter(cacheRequestGatewayFilter, order); - } - - public static class CacheRequestGatewayFilter implements GatewayFilter - { - @Override - public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) - { - // GET DELETE 不过滤 - HttpMethod method = exchange.getRequest().getMethod(); - if (method == null || method == HttpMethod.GET || method == HttpMethod.DELETE) - { - return chain.filter(exchange); - } - return ServerWebExchangeUtils.cacheRequestBodyAndRequest(exchange, (serverHttpRequest) -> { - if (serverHttpRequest == exchange.getRequest()) - { - return chain.filter(exchange); - } - return chain.filter(exchange.mutate().request(serverHttpRequest).build()); - }); - } - } - - @Override - public List shortcutFieldOrder() - { - return Collections.singletonList("order"); - } - - static class Config - { - private Integer order; - - public Integer getOrder() - { - return order; - } - - public void setOrder(Integer order) - { - this.order = order; - } - } -} \ No newline at end of file diff --git a/ruoyi-ui/src/assets/styles/sidebar.scss b/ruoyi-ui/src/assets/styles/sidebar.scss index 9f390460..f1c821f1 100644 --- a/ruoyi-ui/src/assets/styles/sidebar.scss +++ b/ruoyi-ui/src/assets/styles/sidebar.scss @@ -25,7 +25,7 @@ z-index: 1001; overflow: hidden; -webkit-box-shadow: 2px 0 6px rgba(0,21,41,.35); - box-shadow: 2px 0 6px rgba(0,21,41,.35); + box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1); // reset element-ui css .horizontal-collapse-transition { diff --git a/ruoyi-ui/src/components/Editor/index.vue b/ruoyi-ui/src/components/Editor/index.vue index b0487ff0..66209ff3 100644 --- a/ruoyi-ui/src/components/Editor/index.vue +++ b/ruoyi-ui/src/components/Editor/index.vue @@ -18,6 +18,7 @@ + diff --git a/ruoyi-ui/src/components/ImageUpload/index.vue b/ruoyi-ui/src/components/ImageUpload/index.vue index 7da56eb0..4966c654 100644 --- a/ruoyi-ui/src/components/ImageUpload/index.vue +++ b/ruoyi-ui/src/components/ImageUpload/index.vue @@ -6,6 +6,7 @@ list-type="picture-card" :on-success="handleUploadSuccess" :before-upload="handleBeforeUpload" + :data="data" :limit="limit" :on-error="handleUploadError" :on-exceed="handleExceed" @@ -48,6 +49,15 @@ import { getToken } from "@/utils/auth"; export default { props: { value: [String, Object, Array], + // 上传接口地址 + action: { + type: String, + default: "/file/upload" + }, + // 上传携带的参数 + data: { + type: Object + }, // 图片数量限制 limit: { type: Number, @@ -76,7 +86,7 @@ export default { dialogImageUrl: "", dialogVisible: false, hideUpload: false, - uploadImgUrl: process.env.VUE_APP_BASE_API + "/file/upload", // 上传的图片服务器地址 + uploadImgUrl: process.env.VUE_APP_BASE_API + this.action, // 上传的图片服务器地址 headers: { Authorization: "Bearer " + getToken(), }, diff --git a/ruoyi-ui/src/components/RightToolbar/index.vue b/ruoyi-ui/src/components/RightToolbar/index.vue index 67da2930..8ecf5fb3 100644 --- a/ruoyi-ui/src/components/RightToolbar/index.vue +++ b/ruoyi-ui/src/components/RightToolbar/index.vue @@ -12,9 +12,14 @@ + + + 列展示 + +
@@ -41,33 +46,33 @@ export default { // 弹出层标题 title: "显示/隐藏", // 是否显示弹出层 - open: false, + open: false }; }, props: { /* 是否显示检索条件 */ showSearch: { type: Boolean, - default: true, + default: true }, /* 显隐列信息 */ columns: { - type: Array, + type: Array }, /* 是否显示检索图标 */ search: { type: Boolean, - default: true, + default: true }, /* 显隐列类型(transfer穿梭框、checkbox复选框) */ showColumnsType: { type: String, - default: "checkbox", + default: "checkbox" }, /* 右外边距 */ gutter: { type: Number, - default: 10, + default: 10 }, }, computed: { @@ -77,6 +82,15 @@ export default { ret.marginRight = `${this.gutter / 2}px`; } return ret; + }, + isChecked: { + get() { + return this.columns.every((col) => col.visible); + }, + set() {} + }, + isIndeterminate() { + return this.columns.some((col) => col.visible) && !this.isChecked; } }, created() { @@ -109,9 +123,14 @@ export default { showColumn() { this.open = true; }, - // 勾选 + // 单勾选 checkboxChange(event, label) { this.columns.filter(item => item.label == label)[0].visible = event; + }, + // 切换全选/反选 + toggleCheckAll() { + const newValue = !this.isChecked; + this.columns.forEach((col) => (col.visible = newValue)) } }, }; @@ -126,4 +145,10 @@ export default { ::v-deep .el-transfer__button:first-child { margin-bottom: 10px; } +.check-line { + width: 90%; + height: 1px; + background-color: #ccc; + margin: 3px auto; +} diff --git a/ruoyi-ui/src/components/TopNav/index.vue b/ruoyi-ui/src/components/TopNav/index.vue index e27a12f6..6a5aff02 100644 --- a/ruoyi-ui/src/components/TopNav/index.vue +++ b/ruoyi-ui/src/components/TopNav/index.vue @@ -57,7 +57,7 @@ export default { this.routers.map((menu) => { if (menu.hidden !== true) { // 兼容顶部栏一级菜单内部跳转 - if (menu.path === "/") { + if (menu.path === '/' && menu.children) { topMenus.push(menu.children[0]); } else { topMenus.push(menu); diff --git a/ruoyi-ui/src/views/login.vue b/ruoyi-ui/src/views/login.vue index 5185371a..b4a03728 100644 --- a/ruoyi-ui/src/views/login.vue +++ b/ruoyi-ui/src/views/login.vue @@ -176,6 +176,7 @@ export default { background: #ffffff; width: 400px; padding: 25px 25px 5px 25px; + z-index: 1; .el-input { height: 38px; input { diff --git a/ruoyi-ui/src/views/system/user/authRole.vue b/ruoyi-ui/src/views/system/user/authRole.vue index aeb42225..efbda653 100644 --- a/ruoyi-ui/src/views/system/user/authRole.vue +++ b/ruoyi-ui/src/views/system/user/authRole.vue @@ -10,7 +10,7 @@ - + @@ -20,10 +20,10 @@ - + @@ -52,14 +52,14 @@ export default { name: "AuthRole", data() { return { - // 遮罩层 + // 遮罩层 loading: true, // 分页信息 total: 0, pageNum: 1, pageSize: 10, // 选中角色编号 - roleIds:[], + roleIds: [], // 角色信息 roles: [], // 用户信息 @@ -88,7 +88,9 @@ export default { methods: { /** 单击选中行数据 */ clickRow(row) { - this.$refs.table.toggleRowSelection(row); + if (this.checkSelectable(row)) { + this.$refs.table.toggleRowSelection(row); + } }, // 多选框选中数据 handleSelectionChange(selection) { @@ -98,6 +100,10 @@ export default { getRowKey(row) { return row.roleId; }, + // 检查角色状态 + checkSelectable(row) { + return row.status === "0" ? true : false; + }, /** 提交按钮 */ submitForm() { const userId = this.form.userId; diff --git a/sql/ry_20240629.sql b/sql/ry_20250425.sql similarity index 99% rename from sql/ry_20240629.sql rename to sql/ry_20250425.sql index a9b89d48..90f3d3a4 100644 --- a/sql/ry_20240629.sql +++ b/sql/ry_20250425.sql @@ -52,7 +52,7 @@ create table sys_user ( sex char(1) default '0' comment '用户性别(0男 1女 2未知)', avatar varchar(100) default '' comment '头像地址', password varchar(100) default '' comment '密码', - status char(1) default '0' comment '帐号状态(0正常 1停用)', + status char(1) default '0' comment '账号状态(0正常 1停用)', del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)', login_ip varchar(128) default '' comment '最后登录IP', login_date datetime comment '最后登录时间', diff --git a/sql/ry_config_20250224.sql b/sql/ry_config_20250224.sql index 842c6e53..a01ed9f3 100644 --- a/sql/ry_config_20250224.sql +++ b/sql/ry_config_20250224.sql @@ -34,7 +34,7 @@ CREATE TABLE `config_info` ( insert into config_info(id, data_id, group_id, content, md5, gmt_create, gmt_modified, src_user, src_ip, app_name, tenant_id, c_desc, c_use, effect, type, c_schema, encrypted_data_key) values (1,'application-dev.yml','DEFAULT_GROUP','spring:\n autoconfigure:\n exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure\n\n# feign 配置\nfeign:\n sentinel:\n enabled: true\n okhttp:\n enabled: true\n httpclient:\n enabled: false\n client:\n config:\n default:\n connectTimeout: 10000\n readTimeout: 10000\n compression:\n request:\n enabled: true\n min-request-size: 8192\n response:\n enabled: true\n\n# 暴露监控端点\nmanagement:\n endpoints:\n web:\n exposure:\n include: \'*\'\n','9928f41dfb10386ad38b3254af5692e0','2020-05-20 12:00:00','2024-08-29 12:14:45','nacos','0:0:0:0:0:0:0:1','','','通用配置','null','null','yaml','',''), -(2,'ruoyi-gateway-dev.yml','DEFAULT_GROUP','spring:\n redis:\n host: localhost\n port: 6379\n password: \n cloud:\n gateway:\n discovery:\n locator:\n lowerCaseServiceId: true\n enabled: true\n routes:\n # 认证中心\n - id: ruoyi-auth\n uri: lb://ruoyi-auth\n predicates:\n - Path=/auth/**\n filters:\n # 验证码处理\n - CacheRequestFilter\n - ValidateCodeFilter\n - StripPrefix=1\n # 代码生成\n - id: ruoyi-gen\n uri: lb://ruoyi-gen\n predicates:\n - Path=/code/**\n filters:\n - StripPrefix=1\n # 定时任务\n - id: ruoyi-job\n uri: lb://ruoyi-job\n predicates:\n - Path=/schedule/**\n filters:\n - StripPrefix=1\n # 系统模块\n - id: ruoyi-system\n uri: lb://ruoyi-system\n predicates:\n - Path=/system/**\n filters:\n - StripPrefix=1\n # 文件服务\n - id: ruoyi-file\n uri: lb://ruoyi-file\n predicates:\n - Path=/file/**\n filters:\n - StripPrefix=1\n\n# 安全配置\nsecurity:\n # 验证码\n captcha:\n enabled: true\n type: math\n # 防止XSS攻击\n xss:\n enabled: true\n excludeUrls:\n - /system/notice\n\n # 不校验白名单\n ignore:\n whites:\n - /auth/logout\n - /auth/login\n - /auth/register\n - /*/v2/api-docs\n - /*/v3/api-docs\n - /csrf\n\n# springdoc配置\nspringdoc:\n webjars:\n # 访问前缀\n prefix:\n','4d329eb08a941a8dd9d26f542c6ac6c5','2020-05-14 14:17:55','2024-09-02 12:13:50','nacos','0:0:0:0:0:0:0:1','','','网关模块','null','null','yaml','',''), +(2,'ruoyi-gateway-dev.yml','DEFAULT_GROUP','spring:\n redis:\n host: localhost\n port: 6379\n password: \n cloud:\n gateway:\n discovery:\n locator:\n lowerCaseServiceId: true\n enabled: true\n routes:\n # 认证中心\n - id: ruoyi-auth\n uri: lb://ruoyi-auth\n predicates:\n - Path=/auth/**\n filters:\n # 验证码处理\n - CacheRequestBody\n - ValidateCodeFilter\n - StripPrefix=1\n # 代码生成\n - id: ruoyi-gen\n uri: lb://ruoyi-gen\n predicates:\n - Path=/code/**\n filters:\n - StripPrefix=1\n # 定时任务\n - id: ruoyi-job\n uri: lb://ruoyi-job\n predicates:\n - Path=/schedule/**\n filters:\n - StripPrefix=1\n # 系统模块\n - id: ruoyi-system\n uri: lb://ruoyi-system\n predicates:\n - Path=/system/**\n filters:\n - StripPrefix=1\n # 文件服务\n - id: ruoyi-file\n uri: lb://ruoyi-file\n predicates:\n - Path=/file/**\n filters:\n - StripPrefix=1\n\n# 安全配置\nsecurity:\n # 验证码\n captcha:\n enabled: true\n type: math\n # 防止XSS攻击\n xss:\n enabled: true\n excludeUrls:\n - /system/notice\n\n # 不校验白名单\n ignore:\n whites:\n - /auth/logout\n - /auth/login\n - /auth/register\n - /*/v2/api-docs\n - /*/v3/api-docs\n - /csrf\n\n# springdoc配置\nspringdoc:\n webjars:\n # 访问前缀\n prefix:\n','4d329eb08a941a8dd9d26f542c6ac6c5','2020-05-14 14:17:55','2024-09-02 12:13:50','nacos','0:0:0:0:0:0:0:1','','','网关模块','null','null','yaml','',''), (3,'ruoyi-auth-dev.yml','DEFAULT_GROUP','spring:\n redis:\n host: localhost\n port: 6379\n password: \n','a03e7632a0a74520eeb4fbedd6d82d97','2020-11-20 00:00:00','2024-09-02 12:13:58','nacos','0:0:0:0:0:0:0:1','','','认证中心','null','null','yaml','',''), (4,'ruoyi-monitor-dev.yml','DEFAULT_GROUP','# spring\nspring:\n security:\n user:\n name: ruoyi\n password: 123456\n boot:\n admin:\n ui:\n title: 若依服务状态监控\n','6f122fd2bfb8d45f858e7d6529a9cd44','2020-11-20 00:00:00','2024-08-29 12:15:11','nacos','0:0:0:0:0:0:0:1','','','监控中心','null','null','yaml','',''), (5,'ruoyi-system-dev.yml','DEFAULT_GROUP','# spring配置\nspring:\n redis:\n host: localhost\n port: 6379\n password: \n datasource:\n druid:\n stat-view-servlet:\n enabled: true\n loginUsername: ruoyi\n loginPassword: 123456\n dynamic:\n druid:\n initial-size: 5\n min-idle: 5\n maxActive: 20\n maxWait: 60000\n connectTimeout: 30000\n socketTimeout: 60000\n timeBetweenEvictionRunsMillis: 60000\n minEvictableIdleTimeMillis: 300000\n validationQuery: SELECT 1 FROM DUAL\n testWhileIdle: true\n testOnBorrow: false\n testOnReturn: false\n poolPreparedStatements: true\n maxPoolPreparedStatementPerConnectionSize: 20\n filters: stat,slf4j\n connectionProperties: druid.stat.mergeSql\\=true;druid.stat.slowSqlMillis\\=5000\n datasource:\n # 主库数据源\n master:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: password\n # 从库数据源\n # slave:\n # username: \n # password: \n # url: \n # driver-class-name: \n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.ruoyi.system\n # 配置mapper的扫描,找到所有的mapper.xml映射文件\n mapperLocations: classpath:mapper/**/*.xml\n\n# springdoc配置\nspringdoc:\n gatewayUrl: http://localhost:8080/${spring.application.name}\n api-docs:\n # 是否开启接口文档\n enabled: true\n info:\n # 标题\n title: \'系统模块接口文档\'\n # 描述\n description: \'系统模块接口描述\'\n # 作者信息\n contact:\n name: RuoYi\n url: https://ruoyi.vip\n','786c7daf4543411fc65c3e48dfb15243','2020-11-20 00:00:00','2024-09-02 12:14:33','nacos','0:0:0:0:0:0:0:1','','','系统模块','null','null','yaml','',''),