erupt 我打我自己-你能奈我何

一,介绍

 erupt   -  零前端代码,几行Java注解,搞定后台管理系统

而且自己能通过页面操作,生成后端代码。实现自己打自己...

目前不支持热启动,会自动更新生成表,只需维护实体类。

集群需要redis支持,记录会话

适合自己做小项目,上手很快,国产项目,目前有很多坑,后续会把踩坑的记录在文章中更新,本次只是给不喜欢做前端的人一个快速搭建管理系统的工具。

二,官方文档入口

使用文档(1.8.x) · 语雀

接入基本上是按照文档复制粘贴,没啥好讲的

唯一报错还是创建的数据库字符集问题

Caused by: java.sql.SQLException: Incorrect string value: '\xE4\xBB\xA3\xE7\xA0\x81...' for column 'name' at row 1

创建时设置编码

create database erupt character set utf8;
drop database erupt;

为了减少大家时间,我把pom.xml和application.yml粘贴如下:

1,pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>demo</artifactId>
        <groupId>com.example</groupId>
        <version>0.0.1-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
   <name>erupt</name>
    <artifactId>erupt</artifactId>
    <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <erupt.version>1.8.5</erupt.version>
    </properties>

    <dependencies>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <!--接口数据安全-->
        <dependency>
            <groupId>xyz.erupt</groupId>
            <artifactId>erupt-security</artifactId>
            <version>${erupt.version}</version>
        </dependency>
        <!--用户权限管理-->
        <dependency>
            <groupId>xyz.erupt</groupId>
            <artifactId>erupt-upms</artifactId>
            <version>${erupt.version}</version>
        </dependency>

        <dependency>
            <groupId>xyz.erupt</groupId>
            <artifactId>erupt-web</artifactId>
            <version>${erupt.version}</version>
        </dependency>

        <dependency>
            <groupId>xyz.erupt</groupId>
            <artifactId>erupt-job</artifactId>
            <version>${erupt.version}</version>
        </dependency>

        <dependency>
            <groupId>xyz.erupt</groupId>
            <artifactId>erupt-tpl</artifactId>
            <version>${erupt.version}</version>
        </dependency>

        <dependency>
            <groupId>xyz.erupt</groupId>
            <artifactId>erupt-generator</artifactId>
            <version>${erupt.version}</version>
        </dependency>

        <dependency>
            <groupId>xyz.erupt</groupId>
            <artifactId>erupt-monitor</artifactId>
            <version>${erupt.version}</version>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${maven.compiler.source}</source><!--源码使用的开发版本-->
                    <target>${maven.compiler.target}</target><!--需要生产目标lass文件的编译版本-->
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <fork>true</fork><!--true:将项目依赖的jar添加到打包的lib目录下;flase:不包含依赖的jar-->
                    <mainClass></mainClass>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <finalName>${project.name}-${project.version}</finalName>
    </build>
</project>

2,application.yml

erupt-app:
  # 登录失败几次出现验证码,值为0时表示一直需要登录验证码
  verifyCodeCount: 2
  # 登录密码是否加密传输,特殊场景如:LDAP登录可关闭该功能获取密码明文
  pwdTransferEncrypt: true
  # 多语言配置,默认支持:简体中文、繁体中文、英文、日文;具体配置详见erupt-i18n模块
  #locales: [ "zh-CN","zh-TW","en-US","ja-JP"]
erupt:
  # 是否开启csrf防御
  csrfInspect: true
  # 开启redis方式存储session,默认false,开启后需在配置文件中添加redis配置(同 Spring Boot)
  redisSession: false
  # 附件上传存储路径, 默认路径为:/opt/erupt-attachment
  uploadPath: D:/erupt/pictures
  # 是否保留上传文件原始名称
  keepUploadFileName: false
  # 登录session时长(redisSession为true时有效)
  upms.expireTimeByLogin: 60
  # 是否开启任务调度(导入erupt-job时有效)
  job.enable: true
  # 是否记录操作日志,默认true,该功能开启后可在【系统管理 → 操作日志】中查看操作日志
  security.recordOperateLog: true

# application.yml写法
spring:
  datasource:
    url: jdbc:mysql://localhost:3306/erupt?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
    username: root
    password: 123456
  jpa:
    show-sql: true
    generate-ddl: true
    open-in-view: true
    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
    database: mysql

三,启动后页面

http://localhost:8080/#/passport/login

erupt/erupt

四,自己打自己

1,新增页面

2,添加字段

3,查看生成代码

 

4,查看效果

通过把生成的代码复制到代码中后重启,然后在系统管理的菜单管理内添加菜单,刷新后页面如下

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Erupt 是一个快速开发企业级后台管理系统的开源框架,它提供了丰富的组件和工具,可以快速搭建出功能强大、易于维护的后台管理系统。其中,自定义按钮是 Erupt 非常实用的一个组件,可以自定义按钮的样式、文本、点击事件等属性,实现自定义的功能。下面是一个实现自定义按钮的示例: 首先,在 Erupt 的实体类中添加一个按钮属性: ```java @EruptField( views = @View(title = "操作", sortable = false), edit = @Edit(title = "操作"), search = @Search, actions = { @Action(title = "自定义按钮", name = "customButton") } ) private String button; public String getButton() { return button; } public void setButton(String button) { this.button = button; } ``` 这里使用了 `@Action` 注解来定义一个名为 "customButton" 的自定义按钮。 然后,在 Erupt 的页面中添加按钮的 HTML 代码: ```html <div class="btn-group"> <button class="btn btn-success" onclick="erupt.handleButtonClick(this, 'customButton')">自定义按钮</button> </div> ``` 这里使用了 Bootstrap 框架的样式来渲染按钮,并且通过 `erupt.handleButtonClick` 函数来触发按钮的点击事件。 最后,在 Erupt 的 Controller 中处理按钮的点击事件: ```java @RequestMapping("/erupt/customButton") @ResponseBody public Object customButton() { // 处理按钮的点击事件,返回响应结果 return "自定义按钮被点击了"; } ``` 这里使用了 `@RequestMapping` 注解来定义按钮的访问路径,并在方法中处理按钮的点击事件。返回的响应结果将在页面上显示出来。 这样就完成了自定义按钮的实现。你可以根据实际需求来定义按钮的样式、文本、点击事件等属性。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值