Giter VIP home page Giter VIP logo

elunez / eladmin-mp Goto Github PK

View Code? Open in Web Editor NEW
392.0 9.0 155.0 1.03 MB

eladmin mybatis-plus版本:项目基于 Spring Boot 2.6.4 、MyBatis-Plus、Spring Security、Redis、Vue的前后端分离的后台管理系统, 权限控制采用 RBAC,支持数据字典与数据权限管理,支持一键生成前后端代码,支持动态路由

Home Page: https://eladmin.vip/demo

License: Apache License 2.0

JavaScript 8.54% HTML 0.04% Vue 30.21% SCSS 1.15% Java 53.97% FreeMarker 2.24% PLpgSQL 3.85%
admin eladmin element-ui mybaits-plus redis spring-security springboot vue

eladmin-mp's People

Contributors

alexswdd avatar chiujun avatar elunez avatar ifangng avatar leebaul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eladmin-mp's Issues

样式建议

个人看法,表格用带网格线的,分页条加上background属性,并且居右,感觉会更好一点
image

项目启动后,首次登录比较慢

微信图片_20230705113959

启动项目首次登录比较慢,后面再登录就正常了,看日志是加载了yauua这个插件
我的处理方式是项目启动后,程序自动去调下登录接口,后面登录就快了,不知道有没有更好的处理方式。

邮件功能异常bug

  1. 确少依赖,导致无法获取到邮件模版
    org.apache.velocity
    velocity-engine-core
    2.2
  2. 在修改邮箱时,比对验证码无效,原因:存入redis的key以旧邮箱为key,取的时候以新邮箱为key
  3. 修改邮箱成功后没有正确保存新邮箱,原因:还是存的原来的邮箱地址,字段引入错误

mp版本的翻页功能不正常

mp版本无法翻页,始终显示第一页数据,看了一下,好像是前端请求参数和Page类的属性名不一致导致的,前端请求是”page“,Page里是”current"
另外,前端请求中page下标是从0开始的,后端是从1开始的。

validation注解校验不生效,需要引入依赖

image
eladmin-system 中maven依赖中的validation来自接口文档,入参使用validation注解根本不生效,需要引入依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> </dependency>
image
引入之后就正常生效了

common模块中的SwaggerConfig的配置

common模块中的SwaggerConfig#getContextByPath的配置是不是不太对

auth开头的请求,不需要请求头token, 但是像/auth/info、/auth/online这种,都是需要token认证的

设置默认查询条件反应卡顿,无法再次手动更改

例如系统工具>本地存储管理,设置默认查询条件会导致el-input无法再次输入,<date-range-picker延迟选择等问题,请问应该如何设置默认值?

问题截图:

chrome-capture-2023-7-3

复现流程:

  1. 找到 src\views\tools\storage\local\index.vue文件中的搜索框区域,如下:
<div v-if="crud.props.searchToggle">
  <!-- 搜索 -->
  <el-input v-model="query.blurry" clearable size="small" placeholder="输入内容模糊搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
  <date-range-picker v-model="query.createTime" class="date-item" />
  <rrOperation />
</div>
  1. CRUD.HOOK.beforeRefresh钩子函数中设置默认查询条件,如下:

注意: 如果在created生命周期内不仅不会立即生效也还是会出现同样问题;

  // 钩子:在获取表格数据之前执行,false 则代表不获取数据
  [CRUD.HOOK.beforeRefresh]() {
    // 默认今天
    if (!this.query.createTime) {
      let startTime = new Date(new Date().setHours(0, 0, 0))
      let endTime = new Date(new Date().setHours(23, 59, 59))
      startTime = startTime.strftime('%Y-%m-%d %H:%M:%S')
      endTime = endTime.strftime('%Y-%m-%d %H:%M:%S')
      this.query.createTime = [startTime, endTime]
    }
    if (!this.query.blurry) {
      this.query.blurry = 'bestsellers'
    }
    return true
  },
  1. 搜索框无法清除内容也不能输入内容,日期选择框选择后没有反应,再次点击查询才出现;

chrome-capture-2023-7-3

后端项目无法启动

Jdk1.8 环境,macos

OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
Connected to the target VM, address: '127.0.0.1:56923', transport: 'socket'
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
       _                 _           _
      | |               | |         (_)
   ___| |______ __ _  __| |_ __ ___  _ _ __
  / _ | |______/ _` |/ _` | '_ ` _ \| | '_ \
 |  __| |     | (_| | (_| | | | | | | | | | |
  \___|_|      \__,_|\__,_|_| |_| |_|_|_| |_|

 :: Spring Boot ::       (v2.6.4)
elAdmin- 2023-08-31 15:52:55 [main] INFO  me.zhengjie.AppRun - Starting AppRun using Java 15 on MacBook-Pro-5.local with PID 91774 (/Users/iceewei/projects/fullstack/eladmin-mp/eladmin/eladmin-system/target/classes started by iceewei in /Users/iceewei/projects/fullstack/eladmin-mp/eladmin)
elAdmin- 2023-08-31 15:52:55 [main] INFO  me.zhengjie.AppRun - The following 1 profile is active: "dev"
elAdmin- 2023-08-31 15:52:57 [main] INFO  o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8000 (http)
elAdmin- 2023-08-31 15:52:57 [main] INFO  o.a.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8000"]
elAdmin- 2023-08-31 15:52:57 [main] INFO  o.a.catalina.core.StandardService - Starting service [Tomcat]
elAdmin- 2023-08-31 15:52:57 [main] INFO  o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.58]
elAdmin- 2023-08-31 15:52:57 [main] INFO  o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
elAdmin- 2023-08-31 15:52:57 [main] INFO  o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 2019 ms
Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter.
elAdmin- 2023-08-31 15:52:57 [main] WARN  o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'appController' defined in file [/Users/iceewei/projects/fullstack/eladmin-mp/eladmin/eladmin-system/target/classes/me/zhengjie/modules/mnt/rest/AppController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'appServiceImpl' defined in file [/Users/iceewei/projects/fullstack/eladmin-mp/eladmin/eladmin-system/target/classes/me/zhengjie/modules/mnt/service/impl/AppServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'appMapper' defined in file [/Users/iceewei/projects/fullstack/eladmin-mp/eladmin/eladmin-system/target/classes/me/zhengjie/modules/mnt/mapper/AppMapper.class]: Cannot resolve reference to bean 'sqlSessionTemplate' while setting bean property 'sqlSessionTemplate'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionTemplate' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionTemplate' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
elAdmin- 2023-08-31 15:52:57 [main] INFO  o.a.catalina.core.StandardService - Stopping service [Tomcat]
elAdmin- 2023-08-31 15:52:58 [main] INFO  o.s.b.a.l.ConditionEvaluationReportLoggingListener - 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
elAdmin- 2023-08-31 15:52:58 [main] ERROR o.s.b.d.LoggingFailureAnalysisReporter - 

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class


Action:

Consider the following:
	If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
	If you have database settings to be loaded from a particular profile you may need to activate it (the profiles dev are currently active).

Disconnected from the target VM, address: '127.0.0.1:56923', transport: 'socket'

Process finished with exit code 1

我的配置文件。 配置文件里我改动了2处。第1处是mysql的3306端口,我改为了3350;第2处是mysql的password,我改为了root,其他没有改动。

# Sql日志
mybatis-plus:
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

#配置数据源
spring:
  datasource:
    druid:
      db-type: com.alibaba.druid.pool.DruidDataSource
      driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
      url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3350}/${DB_NAME:eladmin}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
      username: ${DB_USER:root}
      password: ${DB_PWD:root}
      # 初始连接数
      initial-size: 5
      # 最小连接数
      min-idle: 15
      # 最大连接数
      max-active: 30
      # 超时时间(以秒数为单位)
      remove-abandoned-timeout: 180
      # 获取连接超时时间
      max-wait: 3000
      # 连接有效性检测时间
      time-between-eviction-runs-millis: 60000
      # 连接在池中最小生存的时间
      min-evictable-idle-time-millis: 300000
      # 连接在池中最大生存的时间
      max-evictable-idle-time-millis: 900000
      # 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除
      test-while-idle: true
      # 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个
      test-on-borrow: true
      # 是否在归还到池中前进行检验
      test-on-return: false
      # 检测连接是否有效
      validation-query: select 1
      # 配置监控统计
      webStatFilter:
        enabled: true
      stat-view-servlet:
        enabled: true
        url-pattern: /druid/*
        reset-enable: false
      filter:
        stat:
          enabled: true
          # 记录慢SQL
          log-slow-sql: true
          slow-sql-millis: 1000
          merge-sql: true
        wall:
          config:
            multi-statement-allow: true

# 登录相关配置
login:
  #  是否限制单用户登录
  single-login: false
  # Redis用户登录缓存配置
  user-cache:
    # 存活时间/秒
    idle-time: 21600
  #  验证码
  login-code:
    #  验证码类型配置 查看 LoginProperties 类
    code-type: arithmetic
    #  登录图形验证码有效时间/分钟
    expiration: 2
    #  验证码高度
    width: 111
    #  验证码宽度
    height: 36
    # 内容长度
    length: 2
    # 字体名称,为空则使用默认字体
    font-name:
    # 字体大小
    font-size: 25

#jwt
jwt:
  header: Authorization
  # 令牌前缀
  token-start-with: Bearer
  # 必须使用最少88位的Base64对该令牌进行编码
  base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI=
  # 令牌过期时间 此处单位/毫秒 ,默认4小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
  token-validity-in-seconds: 14400000
  # 在线用户key
  online-key: "online-token:"
  # 验证码
  code-key: "captcha-code:"
  # token 续期检查时间范围(默认30分钟,单位毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期
  detect: 1800000
  # 续期时间范围,默认1小时,单位毫秒
  renew: 3600000

#是否允许生成代码,生产环境设置为false
generator:
  enabled: true

#是否开启 swagger-ui
swagger:
  enabled: true

# 文件存储路径
file:
  mac:
    path: ~/file/
    avatar: ~/avatar/
  linux:
    path: /home/eladmin/file/
    avatar: /home/eladmin/avatar/
  windows:
    path: C:\eladmin\file\
    avatar: C:\eladmin\avatar\
  # 文件大小 /M
  maxSize: 100
  avatarMaxSize: 5

mybayis-plus处理公共字段有问题

复现步骤:
先对某个部门信息进行编辑,然后再新增一个部门,此时新增的请求表单中,createBy、createTime、updateBy、updateTime会有数据
,就是上次编辑后设值到表单中的,按理新增时这几个字段应该清空下,然而后端使用的是 this.strictInsertFill (有值就不会覆盖),所以导致后续新增,创建时间就不正确,更新时,更新时间也永远不会变化。
image

关于之前我提的一个Issiue

之前我提了一个Issue,是关于前端界面左侧菜单和tagsView在浏览器缩放至一定条件时会出现原生滚动条,如图:
image
最近闲来无事,解决了一下:
1、在sidebar.css28行.scrollbar-wrapper样式下加 &::-webkit-scrollbar { width: 17px; },解决右侧菜单栏垂直滚动条问题;
image
2、在ScrollPanel.vue样式.el-scrollbar__wrap下添加:overflow: hidden;
image

存储管理-文件上传

问题描述:
①选择文件上传A.sh,不填文件名。后台拦截之后,对话框自动填充文件名A.sh;②在不关掉对话框和删改文件名的情况下,选择上传其他文件,如B.txt,确定。会导致传过去的文件名A.sh与实际上传的文件B.txt没有关联性。
文件上传问题1
文件上传问题2
文件上传问题3

token续期功能不生效

登录后redis存登录key代码为:String loginKey = tokenProvider.loginKey(token);
续期redis的key代码为:properties.getOnlineKey() + token
l两者不一致导致续期功能不生效

定时任务分布式部署时重复执行问题

环境:
数据库节点1个
Redis节点1个
项目节点(springboot工程)2个
操作:
配置一个定时任务每分钟执行一次,观察发现两个项目每分钟都在执行,数据库查看定时任务日志也显示每分钟执行了2次

角色管理 菜单分配这都不选时报错

角色管理 菜单分配这都不选时报错
image

Error updating database. Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2 ### The error may exist in file [D:\eladmin-mp\eladmin\eladmin-system\target\classes\mapper\system\RoleMenuMapper.xml] ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: insert into sys_roles_menus (role_id, menu_id) values ### Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2 ; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2

token续期传的不是key

这个package me.zhengjie.modules.security.security;
public void checkRenewal(String token) {
// 判断是否续期token,计算token的过期时间
long time = redisUtils.getExpire(properties.getOnlineKey() + token) * 1000;
Date expireDate = DateUtil.offset(new Date(), DateField.MILLISECOND, (int) time);
// 判断当前时间与过期时间的时间差
long differ = expireDate.getTime() - System.currentTimeMillis();
// 如果在续期检查的范围内,则续期
if (differ <= properties.getDetect()) {
long renew = time + properties.getRenew();
redisUtils.expire(properties.getOnlineKey() + token, renew, TimeUnit.MILLISECONDS);
}
}

401死循环

当已经401了,调用logout接口也是401,就会在这里死循环
image
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.