├── README.md ├── Springboot.iml ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── daq │ │ └── springboot │ │ ├── SpringbootApplication.java │ │ ├── config │ │ ├── AutoCode.java │ │ ├── CorsConfig.java │ │ ├── DruidConfig.java │ │ ├── RedisConfig.java │ │ ├── ShiroConfig.java │ │ └── SwaggerConfig.java │ │ ├── demo │ │ ├── controller │ │ │ ├── AccountController.java │ │ │ └── TestController.java │ │ ├── mapper │ │ │ └── AccountMapper.java │ │ ├── pojo │ │ │ ├── Account.java │ │ │ ├── Login.java │ │ │ └── User.java │ │ └── service │ │ │ ├── AccountService.java │ │ │ └── impl │ │ │ └── AccountServiceImpl.java │ │ ├── notes │ │ ├── JSR303.md │ │ ├── Shiro.md │ │ ├── Swagger.md │ │ ├── druid.md │ │ ├── jedis.md │ │ ├── mail.md │ │ └── mybatis-plus.md │ │ ├── realm │ │ └── AccountRealm.java │ │ └── utils │ │ ├── BufferedImageLuminanceSource.java │ │ ├── MailUtil.java │ │ ├── MailUtilImpl.java │ │ ├── QRCodeUtil.java │ │ └── VerifyUtil.java └── resources │ ├── META-INF │ └── additional-spring-configuration-metadata.json │ ├── application-dev.yml │ ├── application-prod.yml │ ├── application.yml │ ├── banner.txt │ ├── log4j.properties │ ├── static │ └── layui │ │ ├── css │ │ ├── layui.css │ │ ├── layui.mobile.css │ │ └── modules │ │ │ ├── code.css │ │ │ ├── laydate │ │ │ └── default │ │ │ │ └── laydate.css │ │ │ └── layer │ │ │ └── default │ │ │ ├── icon-ext.png │ │ │ ├── icon.png │ │ │ ├── layer.css │ │ │ ├── loading-0.gif │ │ │ ├── loading-1.gif │ │ │ └── loading-2.gif │ │ ├── font │ │ ├── iconfont.eot │ │ ├── iconfont.svg │ │ ├── iconfont.ttf │ │ ├── iconfont.woff │ │ └── iconfont.woff2 │ │ ├── images │ │ └── face │ │ │ ├── 0.gif │ │ │ ├── 1.gif │ │ │ ├── 10.gif │ │ │ ├── 11.gif │ │ │ ├── 12.gif │ │ │ ├── 13.gif │ │ │ ├── 14.gif │ │ │ ├── 15.gif │ │ │ ├── 16.gif │ │ │ ├── 17.gif │ │ │ ├── 18.gif │ │ │ ├── 19.gif │ │ │ ├── 2.gif │ │ │ ├── 20.gif │ │ │ ├── 21.gif │ │ │ ├── 22.gif │ │ │ ├── 23.gif │ │ │ ├── 24.gif │ │ │ ├── 25.gif │ │ │ ├── 26.gif │ │ │ ├── 27.gif │ │ │ ├── 28.gif │ │ │ ├── 29.gif │ │ │ ├── 3.gif │ │ │ ├── 30.gif │ │ │ ├── 31.gif │ │ │ ├── 32.gif │ │ │ ├── 33.gif │ │ │ ├── 34.gif │ │ │ ├── 35.gif │ │ │ ├── 36.gif │ │ │ ├── 37.gif │ │ │ ├── 38.gif │ │ │ ├── 39.gif │ │ │ ├── 4.gif │ │ │ ├── 40.gif │ │ │ ├── 41.gif │ │ │ ├── 42.gif │ │ │ ├── 43.gif │ │ │ ├── 44.gif │ │ │ ├── 45.gif │ │ │ ├── 46.gif │ │ │ ├── 47.gif │ │ │ ├── 48.gif │ │ │ ├── 49.gif │ │ │ ├── 5.gif │ │ │ ├── 50.gif │ │ │ ├── 51.gif │ │ │ ├── 52.gif │ │ │ ├── 53.gif │ │ │ ├── 54.gif │ │ │ ├── 55.gif │ │ │ ├── 56.gif │ │ │ ├── 57.gif │ │ │ ├── 58.gif │ │ │ ├── 59.gif │ │ │ ├── 6.gif │ │ │ ├── 60.gif │ │ │ ├── 61.gif │ │ │ ├── 62.gif │ │ │ ├── 63.gif │ │ │ ├── 64.gif │ │ │ ├── 65.gif │ │ │ ├── 66.gif │ │ │ ├── 67.gif │ │ │ ├── 68.gif │ │ │ ├── 69.gif │ │ │ ├── 7.gif │ │ │ ├── 70.gif │ │ │ ├── 71.gif │ │ │ ├── 8.gif │ │ │ ├── 9.gif │ │ │ └── Starry.png │ │ ├── lay │ │ └── modules │ │ │ ├── carousel.js │ │ │ ├── code.js │ │ │ ├── colorpicker.js │ │ │ ├── element.js │ │ │ ├── flow.js │ │ │ ├── form.js │ │ │ ├── jquery.js │ │ │ ├── laydate.js │ │ │ ├── layedit.js │ │ │ ├── layer.js │ │ │ ├── laypage.js │ │ │ ├── laytpl.js │ │ │ ├── mobile.js │ │ │ ├── rate.js │ │ │ ├── slider.js │ │ │ ├── table.js │ │ │ ├── transfer.js │ │ │ ├── tree.js │ │ │ ├── upload.js │ │ │ └── util.js │ │ ├── layui.all.js │ │ └── layui.js │ └── templates │ ├── shiro │ ├── administrator.html │ ├── index.html │ ├── login.html │ ├── main.html │ └── manage.html │ └── test2.html └── test └── java └── com └── daq └── springboot ├── SpringbootApplicationTests.java ├── demo └── service │ ├── AccountServiceTest.java │ └── test.java └── logTest.java /README.md: -------------------------------------------------------------------------------- 1 | # :floppy_disk:序言 2 | - 项目的基础框架:后端是`SpringBoot`,前端是`layui`,恳求各位大佬一个`star`和`fork`吧!也希望收到指点,与帮助:heart_eyes:!! 3 | - 目前集成了如下组件(完善中~): 4 | 1. `MybatisPlus`:根据表,自动生成代码,简单的sql语句不用写,不过复杂的多表查询还是要自己动手的。 5 | 1. `Druid`数据源:安全可靠,还有可视化界面。 6 | 2. `Redis`缓存:需要在本地开启`redis`。 7 | 3. `Shiro`安全框架:更轻量,更简单。 8 | 4. `Swagger`接口文档:自动生成接口文档,有可视化界面。 9 | 5. `Async`异步任务 10 | 6. `mail`邮件任务 11 | 7. `Scheduling`定时任务 12 | 13 | 14 | # :bookmark_tabs:项目结构 15 | 16 | ``` 17 | com 18 | └─daq 19 | └─springboot 20 | │ SpringbootApplication.java #启动类 21 | │ 22 | ├─config 23 | │ AutoCode.java #MybatisPlus自动生成代码的类 24 | │ DruidConfig.java #Druid数据源配置文件 25 | │ RedisConfig.java #redis序列化配置模板 26 | │ ShiroConfig.java #shiro配置文件 27 | │ SwaggerConfig.java #Swagger配置文件 28 | │ 29 | ├─notes #笔记,记录一些配置的过程 30 | │ druid.md 31 | │ jedis.md 32 | │ JSR303.md 33 | │ mail.md 34 | │ mybatis-plus.md 35 | │ Shiro.md 36 | │ Swagger.md 37 | ├─realm #shiro的认证和授权规则 38 | │ AccountRealm.java 39 | │ 40 | └─utils #工具类 41 | SendMailUtil.java #发送邮件的工具类 42 | ``` 43 | 44 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/20200722161439539.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NDg2MTM5OQ==,size_16,color_FFFFFF,t_70) 45 | 46 | 47 | # :notebook_with_decorative_cover:使用方法 48 | - 将项目导入`IDEA`,用`sql`文件建好数据库。 :gift_heart: 49 | - :christmas_tree:**数据源修改:** 50 | 1. 在`applicatiion-dev.yml`中找到数据源配置,修改你的数据库名,以及用户名和密码。 51 | 2. 在` DruidConfig`中的用户名和密码是后台管理界面的登录账号和密码。 52 | - :fax:**自动生成代码修改:** 53 | 3. 在`AutoCode`中修改生成代码的作者名字。 54 | 4. 更改数据源。 55 | 5. 配置代码生成路径。以及父包的名称。 56 | 6. 在策略配置中,设置要映射的表名,可以一次填写多个,根据表名生成相应的代码。 57 | - :scroll:**redis模板** 58 | 7. 这个可以直接使用 59 | - :bookmark_tabs:**Shiro登录认证配置** 60 | 8. 在`ShiroConfig`中设置与数据库对应的权限。 61 | 9. 设置登录页面 62 | - :horse_racing:**Swagger配置** 63 | 10. 通过`apiInfo()`属性配置文档信息 64 | 11. 配置`docket`以配置`Swagger`具体参数 65 | 66 | - :birthday:**异步任务** 67 | 12. 在`SpringbootApplication`类上加`@EnableAsync`注解,开启异步任务 68 | 13. 然后有异步任务需要的业务层方法上加上 `@Async`注解就实现了异步任务 69 | 70 | - :shaved_ice:**定时任务** 71 | 14. 在`SpringbootApplication`类上加`@EnableScheduling`注解,开启定时任务。 72 | 15. 在业务层的方法上加上`@Scheduled`注解,在注解中写`cron`表达式即可。`cron`表达式怎么写?,百度即可,也有`cron`表达式在线生成工具。 73 | 74 | - :mailbox_with_no_mail:**邮件任务** 75 | 16. 将QQ邮箱的 `POP3/SMTP` 服务开启,获取到邮箱秘钥 76 | 18. 在`yml`配置文件中加入 `用户名`,`邮箱秘钥`,服务器地址(有默认值) 以及加密的配置。 77 | 19. 将方法封装在工具类中,使用的时候调用`MailUtil`的方法,写入消息和发送方。 78 | 79 | 80 | # :telephone:联系我 81 | - 如果有想要加入的童鞋,我们可以一起把这个脚手架做得更好,方便以后开发,提出你想要集成或者你觉得有意思的组件吧。欢迎Q我`2829025551`。 82 | 83 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.3.1.RELEASE 9 | 10 | 11 | com.daq 12 | Springboot 13 | 0.0.1-SNAPSHOT 14 | Springboot 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | 24 | org.springframework.boot 25 | spring-boot-starter-web 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-test 31 | test 32 | 33 | 34 | org.junit.vintage 35 | junit-vintage-engine 36 | 37 | 38 | 39 | 40 | 41 | org.springframework.boot 42 | spring-boot-starter-mail 43 | 44 | 45 | org.springframework 46 | spring-context-support 47 | 48 | 49 | 50 | org.springframework.boot 51 | spring-boot-devtools 52 | true 53 | true 54 | 55 | 56 | 57 | org.projectlombok 58 | lombok 59 | true 60 | 61 | 62 | 63 | org.webjars 64 | jquery 65 | 3.4.1 66 | 67 | 68 | 69 | org.springframework.boot 70 | spring-boot-starter-thymeleaf 71 | 72 | 73 | 74 | org.springframework.boot 75 | spring-boot-configuration-processor 76 | true 77 | 78 | 79 | 80 | org.springframework.boot 81 | spring-boot-starter-validation 82 | 2.1.6.RELEASE 83 | 84 | 85 | 86 | 87 | io.springfox 88 | springfox-swagger2 89 | 2.9.2 90 | 91 | 92 | 93 | com.github.xiaoymin 94 | swagger-bootstrap-ui 95 | 1.9.1 96 | 97 | 98 | 99 | 100 | mysql 101 | mysql-connector-java 102 | 103 | 104 | 105 | com.alibaba 106 | druid 107 | 1.1.21 108 | 109 | 110 | 111 | org.springframework.boot 112 | spring-boot-starter-data-redis 113 | 114 | 115 | 116 | com.baomidou 117 | mybatis-plus-boot-starter 118 | 3.3.1.tmp 119 | 120 | 121 | 122 | com.baomidou 123 | mybatis-plus-generator 124 | 3.3.2 125 | 126 | 127 | 128 | org.apache.velocity 129 | velocity-engine-core 130 | 2.2 131 | 132 | 133 | 134 | 135 | 136 | junit 137 | junit 138 | 4.12 139 | test 140 | 141 | 142 | 143 | org.springframework.boot 144 | spring-boot-starter-log4j 145 | 1.3.8.RELEASE 146 | 147 | 148 | org.slf4j 149 | slf4j-api 150 | 151 | 152 | 153 | 154 | org.apache.shiro 155 | shiro-spring 156 | 1.4.2 157 | 158 | 159 | org.apache.shiro 160 | shiro-core 161 | 1.4.2 162 | 163 | 164 | 165 | com.github.theborakompanioni 166 | thymeleaf-extras-shiro 167 | 2.0.0 168 | 169 | 170 | 171 | 172 | com.google.zxing 173 | core 174 | 3.1.0 175 | 176 | 177 | 178 | 179 | cn.hutool 180 | hutool-all 181 | 5.3.10 182 | 183 | 184 | 185 | 186 | 187 | 188 | org.springframework.boot 189 | spring-boot-maven-plugin 190 | 191 | 192 | 193 | true 194 | 195 | 196 | 197 | org.apache.maven.plugins 198 | maven-surefire-plugin 199 | 2.22.1 200 | 201 | 202 | true 203 | 204 | 205 | 206 | 207 | 208 | 209 | -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/SpringbootApplication.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.scheduling.annotation.EnableAsync; 7 | import org.springframework.scheduling.annotation.EnableScheduling; 8 | 9 | @EnableAsync //开启异步任务的注解,在业务层的方法上加上@Async注解就实现了异步任务 10 | @EnableScheduling //开启定时任务的注解,在业务层的方法上加上@Scheduled注解,在注解中写cron表达式即可 11 | @SpringBootApplication 12 | @MapperScan("com.daq.Springboot.demo.mapper") 13 | public class SpringbootApplication { 14 | public static void main(String[] args) throws Exception { SpringApplication.run(SpringbootApplication.class, args); } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/config/AutoCode.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.config; 2 | 3 | import com.baomidou.mybatisplus.annotation.DbType; 4 | import com.baomidou.mybatisplus.annotation.FieldFill; 5 | import com.baomidou.mybatisplus.annotation.IdType; 6 | import com.baomidou.mybatisplus.generator.AutoGenerator; 7 | import com.baomidou.mybatisplus.generator.config.DataSourceConfig; 8 | import com.baomidou.mybatisplus.generator.config.GlobalConfig; 9 | import com.baomidou.mybatisplus.generator.config.PackageConfig; 10 | import com.baomidou.mybatisplus.generator.config.StrategyConfig; 11 | import com.baomidou.mybatisplus.generator.config.po.TableFill; 12 | import com.baomidou.mybatisplus.generator.config.rules.DateType; 13 | import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; 14 | import java.util.ArrayList; 15 | 16 | @SuppressWarnings("all") 17 | public class AutoCode { 18 | 19 | /** 20 | * @author daq 21 | * @deprecated 使用mybatis plus自定义的代码生成器模板,只需要改相应的包名与配置即可 22 | * 还需要加其他的配置请看:mybatisplus官网:https://mp.baomidou.com/guide/ 23 | */ 24 | 25 | public static void main(String[] args) { 26 | // 需要构建一个代码自动生成器对象 27 | AutoGenerator mpg = new AutoGenerator(); 28 | // 配置策略 29 | 30 | // 1、全局配置 31 | GlobalConfig gc = new GlobalConfig(); 32 | String projectPath = System.getProperty("user.dir"); 33 | gc.setOutputDir(projectPath + "/src/main/java"); 34 | gc.setAuthor("代澳旗"); 35 | gc.setOpen(false); 36 | gc.setFileOverride(false); // 是否覆盖 37 | gc.setServiceName("%sService"); // 去Service的I前缀 38 | gc.setIdType(IdType.ID_WORKER); 39 | gc.setDateType(DateType.ONLY_DATE); 40 | gc.setSwagger2(true); 41 | mpg.setGlobalConfig(gc); 42 | 43 | //2、设置数据源 44 | DataSourceConfig dsc = new DataSourceConfig(); 45 | dsc.setUrl("jdbc:mysql://localhost:3306/library1?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8"); 46 | dsc.setDriverName("com.mysql.cj.jdbc.Driver"); 47 | dsc.setUsername("root"); 48 | dsc.setPassword("daq"); 49 | dsc.setDbType(DbType.MYSQL); 50 | mpg.setDataSource(dsc); 51 | 52 | //3、包的配置 53 | PackageConfig pc = new PackageConfig(); 54 | pc.setModuleName("demo1"); //生成在demo1这个包下 55 | pc.setParent("com.daq.Springboot"); //父包 56 | pc.setEntity("entity"); 57 | pc.setMapper("mapper"); 58 | pc.setService("service"); 59 | pc.setController("controller"); 60 | mpg.setPackageInfo(pc); 61 | 62 | 63 | //4、策略配置 64 | StrategyConfig strategy = new StrategyConfig(); 65 | strategy.setInclude("book_info","class_info","lend_list","reader_card","reader_info"); // 设置要映射的表名 66 | strategy.setNaming(NamingStrategy.underline_to_camel); 67 | strategy.setColumnNaming(NamingStrategy.underline_to_camel); 68 | strategy.setEntityLombokModel(true); // 自动lombok; 69 | strategy.setLogicDeleteFieldName("deleted"); 70 | // 自动填充配置 71 | TableFill gmtCreate = new TableFill("gmt_create", FieldFill.INSERT); 72 | TableFill gmtModified = new TableFill("gmt_modified", FieldFill.INSERT_UPDATE); 73 | ArrayList tableFills = new ArrayList<>(); 74 | tableFills.add(gmtCreate); 75 | tableFills.add(gmtModified); 76 | strategy.setTableFillList(tableFills); 77 | // 乐观锁 78 | strategy.setVersionFieldName("version"); 79 | strategy.setRestControllerStyle(true); 80 | strategy.setControllerMappingHyphenStyle(true);//localhost:8080/hello_id_2 81 | mpg.setStrategy(strategy); 82 | mpg.execute(); //执行 83 | } 84 | } -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/config/CorsConfig.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 6 | 7 | /** 8 | * @author 代澳旗 9 | * 前后端分离的项目中,接口和页面往往部署中不同的服务中,这个时候就是出现跨域的问题 10 | * 通过实现WebMvcConfigurer接口然后重写addCorsMappings方法解决跨域问题。 11 | */ 12 | 13 | @Configuration 14 | @SuppressWarnings("all") 15 | public class CorsConfig implements WebMvcConfigurer { 16 | 17 | @Override 18 | public void addCorsMappings(CorsRegistry registry) { 19 | String mapping = "/**"; // 所有请求,也可配置成特定请求,如/api/** 20 | String origins = "*"; // 所有来源,也可以配置成特定的来源才允许跨域,如http://www.xxxx.com 21 | String methods = "*"; // 所有方法,GET、POST、PUT等 22 | registry.addMapping(mapping).allowedOrigins(origins).allowedMethods(methods).allowCredentials(true); 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/config/DruidConfig.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.config; 2 | 3 | import com.alibaba.druid.pool.DruidDataSource; 4 | import com.alibaba.druid.support.http.StatViewServlet; 5 | import com.alibaba.druid.support.http.WebStatFilter; 6 | import org.springframework.boot.context.properties.ConfigurationProperties; 7 | import org.springframework.boot.web.servlet.FilterRegistrationBean; 8 | import org.springframework.boot.web.servlet.ServletRegistrationBean; 9 | import org.springframework.context.annotation.Bean; 10 | import org.springframework.context.annotation.Configuration; 11 | import javax.sql.DataSource; 12 | import java.util.Arrays; 13 | import java.util.HashMap; 14 | import java.util.Map; 15 | 16 | @Configuration 17 | @SuppressWarnings("all") 18 | public class DruidConfig { 19 | 20 | /* 21 | 将自定义的 Druid数据源添加到容器中,不再让 Spring Boot 自动创建 22 | 绑定全局配置文件中的 druid 数据源属性到 com.alibaba.druid.pool.DruidDataSource从而让它们生效 23 | @ConfigurationProperties(prefix = "spring.datasource"):作用就是将 全局配置文件中 24 | 前缀为 spring.datasource的属性值注入到 com.alibaba.druid.pool.DruidDataSource 的同名参数中 25 | */ 26 | @ConfigurationProperties(prefix = "spring.datasource") 27 | @Bean 28 | public DataSource druidDataSource() { 29 | return new DruidDataSource(); 30 | } 31 | 32 | //配置 Druid 监控管理后台的,由于内置 Servlet 容器时没有web.xml文件,所以使用 Spring Boot 的注册 Servlet 方式 33 | @Bean 34 | public ServletRegistrationBean statViewServlet() { 35 | ServletRegistrationBean bean = new ServletRegistrationBean(new StatViewServlet(), "/druid/*"); 36 | 37 | // 这些参数可以在 com.alibaba.druid.support.http.StatViewServlet 的父类 com.alibaba.druid.support.http.ResourceServlet 中找到 38 | Map initParams = new HashMap<>(); 39 | initParams.put("loginUsername", "admin"); //后台管理界面的登录账号 40 | initParams.put("loginPassword", "123456"); //后台管理界面的登录密码 41 | 42 | //后台允许谁可以访问 43 | //initParams.put("allow", "localhost"):表示只有本机可以访问 44 | //initParams.put("allow", ""):为空或者为null时,表示允许所有访问 45 | initParams.put("allow", ""); 46 | 47 | //deny:Druid 后台拒绝谁访问 48 | //initParams.put("kuangshen", "192.168.1.20");表示禁止此ip访问 49 | 50 | //设置初始化参数 51 | bean.setInitParameters(initParams); 52 | return bean; 53 | } 54 | 55 | //配置 Druid 监控 之 web 监控的 filter,WebStatFilter:用于配置Web和Druid数据源之间的管理关联监控统计 56 | @Bean 57 | public FilterRegistrationBean webStatFilter() { 58 | FilterRegistrationBean bean = new FilterRegistrationBean(); 59 | bean.setFilter(new WebStatFilter()); 60 | 61 | //exclusions:设置哪些请求进行过滤排除掉,从而不进行统计 62 | Map initParams = new HashMap<>(); 63 | initParams.put("exclusions", "*.js,*.css,/druid/*,/jdbc/*"); 64 | bean.setInitParameters(initParams); 65 | 66 | //"/*" 表示过滤所有请求 67 | bean.setUrlPatterns(Arrays.asList("/*")); 68 | return bean; 69 | } 70 | 71 | } -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/config/RedisConfig.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.config; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 4 | import com.fasterxml.jackson.annotation.PropertyAccessor; 5 | import com.fasterxml.jackson.databind.ObjectMapper; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.data.redis.connection.RedisConnectionFactory; 9 | import org.springframework.data.redis.core.RedisTemplate; 10 | import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; 11 | import org.springframework.data.redis.serializer.StringRedisSerializer; 12 | 13 | /** 14 | * @author daq 15 | * 这是redis的序列化模板,就不用使用redis默认的模板,因为我们有时候传递的数据是json参数,要涉及到序列化。 16 | */ 17 | @Configuration 18 | public class RedisConfig { 19 | @Bean 20 | @SuppressWarnings("all") 21 | public RedisTemplate redisTemplate(RedisConnectionFactory factory) { 22 | // 为了开发方便,一般直接使用 23 | RedisTemplate template=new RedisTemplate(); 24 | template.setConnectionFactory(factory); 25 | // Json序列化配置 26 | Jackson2JsonRedisSerializer jackson2JsonRedisSerializer=new Jackson2JsonRedisSerializer(Object.class); 27 | ObjectMapper om=new ObjectMapper(); 28 | om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); 29 | om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); 30 | jackson2JsonRedisSerializer.setObjectMapper(om); 31 | // String 的序列化 32 | StringRedisSerializer stringRedisSerializer=new StringRedisSerializer(); 33 | // key采用String的序列化方式 34 | template.setKeySerializer(stringRedisSerializer); 35 | // hash的key也采用String的序列化方式 36 | template.setHashKeySerializer(stringRedisSerializer); 37 | // value序列化方式采用jackson 38 | template.setValueSerializer(jackson2JsonRedisSerializer); 39 | // hash的value序列化方式采用jackson 40 | template.setHashValueSerializer(jackson2JsonRedisSerializer); 41 | template.afterPropertiesSet(); 42 | return template; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/config/ShiroConfig.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.config; 2 | 3 | import at.pollux.thymeleaf.shiro.dialect.ShiroDialect; 4 | import com.daq.springboot.realm.AccountRealm; 5 | import org.apache.shiro.spring.web.ShiroFilterFactoryBean; 6 | import org.apache.shiro.web.mgt.DefaultWebSecurityManager; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.context.annotation.Configuration; 10 | import java.util.Hashtable; 11 | import java.util.Map; 12 | 13 | /** 14 | * @author 代澳旗 15 | * 这是shiro的配置文件, 16 | */ 17 | @Configuration 18 | public class ShiroConfig { 19 | 20 | //注入realm 21 | @Bean 22 | public AccountRealm accountRealm(){ 23 | return new AccountRealm(); 24 | } 25 | 26 | //注入安全管理器 27 | @Bean 28 | public DefaultWebSecurityManager securityManager(@Qualifier("accountRealm") AccountRealm accountRealm){ 29 | DefaultWebSecurityManager manager = new DefaultWebSecurityManager(); 30 | manager.setRealm(accountRealm); 31 | return manager; 32 | } 33 | 34 | //注入工厂 35 | @Bean 36 | public ShiroFilterFactoryBean shiroFilterFactoryBean(@Qualifier("securityManager") DefaultWebSecurityManager securityManager){ 37 | ShiroFilterFactoryBean factoryBean = new ShiroFilterFactoryBean(); 38 | factoryBean.setSecurityManager(securityManager); 39 | //权限设置 40 | Map map = new Hashtable<>(); 41 | map.put("/main","authc"); 42 | map.put("/manage","perms[manage]"); 43 | map.put("/administrator","roles[administrator]"); 44 | factoryBean.setFilterChainDefinitionMap(map); 45 | //设置登陆页面 46 | factoryBean.setLoginUrl("/login"); 47 | //设置未授权页面 48 | factoryBean.setUnauthorizedUrl("/unauth"); 49 | return factoryBean; 50 | } 51 | 52 | //shiro整合thymeleaf,要想在html中使用shiro,就必须先引进方言。 53 | @Bean 54 | public ShiroDialect shiroDialect(){ 55 | return new ShiroDialect(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/config/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.core.env.Environment; 6 | import org.springframework.core.env.Profiles; 7 | import springfox.documentation.builders.RequestHandlerSelectors; 8 | import springfox.documentation.service.ApiInfo; 9 | import springfox.documentation.service.Contact; 10 | import springfox.documentation.spi.DocumentationType; 11 | import springfox.documentation.spring.web.plugins.Docket; 12 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 13 | 14 | import java.util.ArrayList; 15 | 16 | /** 17 | * @author 代澳旗 18 | * @description 添加了两个依赖之后,就要编写相应的配置类 19 | */ 20 | 21 | @Configuration 22 | @EnableSwagger2// 开启Swagger2的自动配置 23 | @SuppressWarnings("all") 24 | public class SwaggerConfig { 25 | 26 | //第1步:通过apiInfo()属性配置文档信息 27 | private ApiInfo apiInfo() { 28 | Contact contact = new Contact("代澳旗", "https://daqwt.top/联系人访问链接", "daq2829025551@163.com"); 29 | return new ApiInfo( 30 | "Swagger学习", // 标题 31 | "学习演示如何配置Swagger", // 描述 32 | "v1.0", // 版本 33 | "https://daqwt.top/组织链接", // 组织链接 34 | contact, // 联系人信息 35 | "Apach 2.0 许可", // 许可 36 | "许可链接", // 许可连接 37 | new ArrayList<>()// 扩展 38 | ); 39 | } 40 | 41 | //第2步:Swagger实例Bean是Docket,所以通过配置Docket实例来配置Swaggger。 42 | @Bean //配置docket以配置Swagger具体参数 43 | public Docket docket(Environment environment) { 44 | Profiles of = Profiles.of("dev", "test");// 设置要显示swagger的环境 45 | boolean b = environment.acceptsProfiles(of);//判断当前是否处于该环境,通过 enable() 接收此参数判断是否要显示 46 | return new Docket(DocumentationType.SWAGGER_2) 47 | .groupName("mybatisplus") //分组的名称,如过有多个分组,就设置多个docket方法即可。这里的名字改一下就可以 48 | .apiInfo(apiInfo()) 49 | .select() 50 | .apis(RequestHandlerSelectors.basePackage("com.daq.Springboot.demo.controller"))//根据这个包生成接口文档 51 | .build(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/demo/controller/AccountController.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.demo.controller; 2 | 3 | import com.daq.springboot.demo.pojo.Account; 4 | import com.daq.springboot.utils.MailUtil; 5 | import org.apache.shiro.SecurityUtils; 6 | import org.apache.shiro.authc.IncorrectCredentialsException; 7 | import org.apache.shiro.authc.UnknownAccountException; 8 | import org.apache.shiro.authc.UsernamePasswordToken; 9 | import org.apache.shiro.subject.Subject; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.ui.Model; 13 | import org.springframework.web.bind.annotation.*; 14 | 15 | 16 | /** 17 | * @author daq 18 | * @description 测试一些功能 19 | */ 20 | 21 | @Controller 22 | public class AccountController { 23 | 24 | @Autowired 25 | private MailUtil mailUtil; 26 | 27 | @GetMapping("/{url}") 28 | public String redirect(@PathVariable("url") String url){ 29 | return url; 30 | } 31 | 32 | @PostMapping("/login") 33 | public String login(String username, String password, Model model){ 34 | Subject subject = SecurityUtils.getSubject(); 35 | UsernamePasswordToken token = new UsernamePasswordToken(username,password); 36 | //把传进来的用户名和密码封装成token,通过subject交给shiro去做 37 | try { 38 | //没有异常,来到首页 39 | subject.login(token); 40 | Account account = (Account) subject.getPrincipal(); 41 | subject.getSession().setAttribute("account",account); 42 | return "index"; 43 | } catch (UnknownAccountException e) { 44 | //用户名错误,借助model将错误信息带给前端 45 | e.printStackTrace(); 46 | model.addAttribute("msg","用户名错误!!!"); 47 | return "login"; 48 | } catch (IncorrectCredentialsException e) { 49 | //密码不合法,借助model将错误信息带给前端 50 | e.printStackTrace(); 51 | model.addAttribute("msg","密码错误!!!"); 52 | return "login"; 53 | } 54 | } 55 | 56 | //未授权的页面 57 | @GetMapping("/unauth") 58 | @ResponseBody 59 | public String unauth(){ 60 | return "未授权,无法访问!!!"; 61 | } 62 | 63 | //退出登陆 64 | @GetMapping("/logout") 65 | public String logout(){ 66 | Subject subject = SecurityUtils.getSubject(); 67 | subject.logout(); 68 | return "login2"; 69 | } 70 | 71 | @GetMapping("/sendMail") 72 | public String sendMail(){ 73 | String[] to = {"2829025551@qq.com"}; 74 | mailUtil.sendHtmlMail("你好","haha",to); 75 | return "successful"; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/demo/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.demo.controller; 2 | 3 | import com.daq.springboot.demo.pojo.Login; 4 | import com.daq.springboot.demo.pojo.User; 5 | import io.swagger.annotations.ApiOperation; 6 | import io.swagger.annotations.ApiParam; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.data.redis.core.RedisTemplate; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.ui.Model; 11 | import org.springframework.validation.BindingResult; 12 | import org.springframework.validation.annotation.Validated; 13 | import org.springframework.web.bind.annotation.PostMapping; 14 | import org.springframework.web.bind.annotation.RequestMapping; 15 | import org.springframework.web.bind.annotation.ResponseBody; 16 | 17 | import java.util.Arrays; 18 | import java.util.HashMap; 19 | import java.util.Map; 20 | 21 | 22 | @Controller 23 | @SuppressWarnings("all") 24 | public class TestController { 25 | 26 | @Autowired 27 | private RedisTemplate redisTemplate; 28 | 29 | 30 | //测试简单的数据传输 31 | @RequestMapping("/t1") 32 | public String test1(Model model){ 33 | model.addAttribute("msg","daiaoqi"); 34 | return "test"; 35 | } 36 | 37 | //简单测试redis 38 | @RequestMapping("/testRedis") 39 | public String redis(){ 40 | redisTemplate.opsForValue().set("k2","wt"); 41 | String str = redisTemplate.opsForValue().get("k2"); 42 | return str; 43 | } 44 | 45 | //测试thymeleaf遍历集合 46 | @RequestMapping("/t2") 47 | public String test2(Map map){ 48 | //存入数据 49 | map.put("msg","

Hello

"); 50 | map.put("users", Arrays.asList("daiaoqi","wutong")); 51 | return "test2"; 52 | } 53 | 54 | //测试接口 55 | @RequestMapping("/getUser") 56 | public User getUser(){ 57 | return new User(); 58 | } 59 | 60 | //测试swagger的实体类接口 61 | @ApiOperation("测试实体类接口") 62 | @PostMapping("/daq") 63 | @ResponseBody 64 | public String kuang(@ApiParam("这个名字会被返回")String username){ 65 | return username; 66 | } 67 | 68 | //测试JSR303数据校验 69 | @PostMapping("/tsetValidator") 70 | public Object validatorObject(@Validated Login login, BindingResult br){ 71 | Map errorMap = new HashMap(); 72 | if(br.hasErrors()){ 73 | //对错误集合进行遍历,有的话,直接放入map集合中 74 | br.getFieldErrors().forEach(p->{ 75 | errorMap.put(p.getField(), p.getDefaultMessage()); 76 | }); 77 | } 78 | //返回错误信息 79 | return errorMap; 80 | } 81 | 82 | } -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/demo/mapper/AccountMapper.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.demo.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.daq.springboot.demo.pojo.Account; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * @author 9 | * @description 10 | */ 11 | @Repository 12 | public interface AccountMapper extends BaseMapper { 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/demo/pojo/Account.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.demo.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | /** 8 | * @author 9 | * @description 10 | */ 11 | @Data 12 | @NoArgsConstructor 13 | @AllArgsConstructor 14 | public class Account { 15 | private Integer id; 16 | private String username; 17 | private String password; 18 | private String perms; 19 | private String role; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/demo/pojo/Login.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.demo.pojo; 2 | 3 | /** 4 | * @author 5 | * @description 6 | */ 7 | 8 | import com.fasterxml.jackson.annotation.JsonFormat; 9 | import lombok.Data; 10 | import org.springframework.format.annotation.DateTimeFormat; 11 | import org.springframework.validation.annotation.Validated; 12 | 13 | import javax.validation.constraints.NotNull; 14 | import javax.validation.constraints.Pattern; 15 | import javax.validation.constraints.Size; 16 | import java.util.Date; 17 | 18 | /** 19 | * 实体类 20 | * @author 程就人生 21 | * 22 | */ 23 | @Validated 24 | @Data 25 | @SuppressWarnings("all") 26 | public class Login { 27 | private String userUid; 28 | //用户名不为空,使用默认提示 29 | @NotNull 30 | private String userName; 31 | 32 | //密码进行长度和格式的验证,个性化提示 33 | @Size(min=6, max=15,message="密码长度必须在 6 ~ 15 字符之间!") 34 | @Pattern(regexp="^[a-zA-Z0-9|_]+$",message="密码必须由字母、数字、下划线组成!") 35 | private String userPwd; 36 | 37 | //手机号码也用个性化提示,使用正则表达式进行匹配,非空时不验证 38 | @Pattern(regexp="^1(3|4|5|7|8)\\d{9}$",message="手机号码格式错误!") 39 | private String userMobile; 40 | 41 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") 42 | @DateTimeFormat(pattern="yyyy-MM-dd") 43 | private Date userBirthday; 44 | 45 | private Byte status; 46 | 47 | private Date updateDate; 48 | 49 | private String updateUser; 50 | 51 | private Date createDate; 52 | 53 | private String createUser; 54 | } -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/demo/pojo/User.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.demo.pojo; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | 6 | /** 7 | * @author 8 | * @description 9 | */ 10 | @ApiModel("用户实体") 11 | public class User { 12 | @ApiModelProperty("用户名") 13 | public String username; 14 | @ApiModelProperty("密码") 15 | public String password; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/demo/service/AccountService.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.demo.service; 2 | 3 | import com.daq.springboot.demo.pojo.Account; 4 | 5 | /** 6 | * @author 7 | * @description 8 | */ 9 | public interface AccountService { 10 | 11 | public Account findByUsername(String username); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/demo/service/impl/AccountServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.demo.service.impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.daq.springboot.demo.mapper.AccountMapper; 5 | import com.daq.springboot.demo.pojo.Account; 6 | import com.daq.springboot.demo.service.AccountService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | /** 11 | * @author 12 | * @description 13 | */ 14 | @Service 15 | public class AccountServiceImpl implements AccountService { 16 | 17 | @Autowired 18 | private AccountMapper accountMapper; 19 | 20 | @Override 21 | public Account findByUsername(String username) { 22 | QueryWrapper wrapper = new QueryWrapper(); 23 | wrapper.eq("username",username); 24 | return accountMapper.selectOne(wrapper); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/notes/JSR303.md: -------------------------------------------------------------------------------- 1 | ## JSR303数据校验及多环境切换 2 | 3 | - 用`@validated`来校验数据,如果数据异常则会统一抛出异常,方便异常中心统一处理。 -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/notes/Shiro.md: -------------------------------------------------------------------------------- 1 | # Shiro 2 | 3 | 什么是 Shiro 4 | 5 | 官网:http://shiro.apache.org/ 6 | 7 | 是一款主流的 Java 安全框架,不依赖任何容器,可以运行在 Java SE 和 Java EE 项目中,它的主要作用是对访问系统的用户进行身份认证、授权、会话管理、加密等操作。 8 | 9 | Shiro 就是用来解决安全管理的系统化框架。 10 | 11 | 12 | 13 | # Shiro 核心组件 14 | 15 | 用户、角色、权限 16 | 17 | 会给角色赋予权限,给用户赋予角色 18 | 19 | 1、UsernamePasswordToken,Shiro 用来封装用户登录信息,使用用户的登录信息来创建令牌 Token。 20 | 21 | 2、SecurityManager,Shiro 的核心部分,负责安全认证和授权。 22 | 23 | 3、Suject,Shiro 的一个抽象概念,包含了用户信息。 24 | 25 | 4、Realm,开发者自定义的模块,根据项目的需求,验证和授权的逻辑全部写在 Realm 中。 26 | 27 | 5、AuthenticationInfo,用户的角色信息集合,认证时使用。 28 | 29 | 6、AuthorzationInfo,角色的权限信息集合,授权时使用。 30 | 31 | 7、DefaultWebSecurityManager,安全管理器,开发者自定义的 Realm 需要注入到 DefaultWebSecurityManager 进行管理才能生效。 32 | 33 | 8、ShiroFilterFactoryBean,过滤器工厂,Shiro 的基本运行机制是开发者定制规则,Shiro 去执行,具体的执行操作就是由 ShiroFilterFactoryBean 创建的一个个 Filter 对象来完成。 34 | 35 | 36 | 37 | 38 | # Spring Boot 整合 Shiro 39 | 40 | 1、创建 Spring Boot 应用,集成 Shiro 及相关组件,pom.xml 41 | 42 | ```xml 43 | 44 | org.apache.shiro 45 | shiro-spring 46 | 1.5.3 47 | 48 | ``` 49 | 50 | 2、在 realm 中自定义 Shiro 过滤器 51 | 52 | 3、配置shiroConfig编写认证和授权规则 53 | 54 | > 认证过滤器 55 | 56 | anon:无需认证。 57 | 58 | authc:必须认证。 59 | 60 | authcBasic:需要通过 HTTPBasic 认证。 61 | 62 | user:不一定通过认证,只要曾经被 Shiro 记录即可,比如:记住我。 63 | 64 | 65 | 66 | > 授权过滤器 67 | 68 | perms:必须拥有某个权限才能访问。 69 | 70 | role:必须拥有某个角色才能访问。 71 | 72 | port:请求的端口必须是指定值才可以。 73 | 74 | rest:请求必须基于 RESTful,POST、PUT、GET、DELETE。 75 | 76 | ssl:必须是安全的 URL 请求,协议 HTTPS。 77 | 78 | 79 | 80 | ## Shiro 整合 Thymeleaf 81 | 82 | 1、pom.xml 引入依赖 83 | 84 | ```xml 85 | 86 | com.github.theborakompanioni 87 | thymeleaf-extras-shiro 88 | 2.0.0 89 | 90 | ``` 91 | 92 | 2、配置类添加 ShiroDialect 93 | 94 | ```java 95 | @Bean 96 | public ShiroDialect shiroDialect(){ 97 | return new ShiroDialect(); 98 | } 99 | ``` 100 | 101 | 3. 在html中要加入 102 | ` 103 | ` -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/notes/Swagger.md: -------------------------------------------------------------------------------- 1 | ### 集成swagger 2 | 访问方式 http://localhost:8080/swagger-ui.html 3 | 4 | 第一步:pom文件中引入两个依赖, `springfox-swagger2`和`springfox-swagger-ui` 5 | 6 | 第二步:编写docket配置文件,通过apiInfo()属性配置具体的文档信息,再用docket 实例关联上 apiInfo() 7 | 8 | 第三步:构建Docket时通过.select()方法,去配置扫描接口,RequestHandlerSelectors配置如何扫描接口 9 | 有以下几种扫描接口的方式: 10 | 1. any() // 扫描所有,项目中的所有接口都会被扫描到 11 | 2. none() // 不扫描接口 12 | 3. withMethodAnnotation(final Class annotation)// 通过方法上的注解扫描,如withMethodAnnotation(GetMapping.class)只扫描get请求 13 | 4. withClassAnnotation(final Class annotation)// 通过类上的注解扫描,如.withClassAnnotation(Controller.class)只扫描有controller注解的类中的接口 14 | 5. basePackage(final String basePackage) // 根据包路径扫描接口 15 | 16 | 第四步: 还可以配置接口扫描过滤器,不扫描哪些包 17 | // 配置如何通过path过滤,即这里只扫描请求以/Hello开头的接口 18 | .paths(PathSelectors.ant("/Hello/**")) 19 | // 可选的参数有 20 | 1. any() // 任何请求都扫描 21 | 2. none() // 任何请求都不扫描 22 | 3. regex(final String pathRegex) // 通过正则表达式控制 23 | 4. ant(final String antPattern) // 通过ant()控制 24 | 25 | 第五步: 配置swagger开关 26 | 通过enable()方法配置是否启用swagger,如果是false,swagger将不能在浏览器中访问了 27 | .enable(false) //配置是否启用Swagger,如果是false,在浏览器将无法访问 28 | 29 | 第六步: 动态配置当项目处于test、dev环境时显示swagger,处于prod时不显示 30 | // 设置要显示swagger的环境 31 | Profiles of = Profiles.of("dev", "test"); 32 | // 判断当前是否处于该环境 33 | // 通过 enable() 接收此参数判断是否要显示 34 | boolean b = environment.acceptsProfiles(of); 35 | 根据b标志位判断 36 | .enable(b) //配置是否启用Swagger,如果是false,在浏览器将无法访问 37 | 38 | 第七步:配置API分组 39 | 1. 如果没有配置分组,默认是default 通过groupName()方法即可配置分组 40 | .groupName("hello") // 配置分组 41 | 2. 配置多个分组只需要配置多个docket即可 42 | 43 | 第八步:实体配置 44 | @ApiModel为类添加注释 45 | @ApiModelProperty为类属性添加注释 -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/notes/druid.md: -------------------------------------------------------------------------------- 1 | ## Druid数据源 2 | 1. 导入依赖druid 3 | 2. 在application.yml中配置 4 | spring: 5 | datasource: 6 | username: root 7 | password: 123456 8 | url: jdbc:mysql://localhost:3306/springboot?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8 9 | driver-class-name: com.mysql.cj.jdbc.Driver 10 | type: com.alibaba.druid.pool.DruidDataSource # 自定义数据源 11 | 12 | 3. 导入Log4j 的依赖 13 | 4. 测试后类中测试 14 | 15 | ## 配置Druid数据源监控 16 | - 在配置文件中写好了,直接拿来用,访问页面`http://localhost:8080/druid/login.html` 17 | 18 | ## 配置 Druid web 监控 filter 过滤器 19 | - 也在配置文件中写好 20 | -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/notes/jedis.md: -------------------------------------------------------------------------------- 1 | ## 说明 2 | - SpringBoot 操作数据的有:`spring-data jpa `,`jdbc` ,`mongodb` ,`redis`! 3 | - 在 `SpringBoot2.x` 之后,原来使用的`jedis` 被替换为了 `lettuce` 4 | - `jedis :` 底层采用的直连,如果多个线程操作的话是不安全的,如果想要避免不安全的,使用 `jedis pool` 连接池,这就更像 `BIO` 模式。 5 | - `lettuce :` 采用`netty`,实例可以再多个线程中进行共享,不存在线程不安全的情况!可以减少线程数据了,更像 `NIO `模式 6 | 7 | ## 整合SpringBoot 8 | 1. 导入依赖`spring-boot-starter-data-redis` 9 | 2. 在`application.yml`中配置连接 10 | 3. 默认的序列化方式是JDK序列化,我们会使用json来序列化,关于对象的保存:所有的对象,都需要序列化 11 | 4. 自己定义了一个 RedisTemplate,用的时候就用自己定义的模版就好了,不用担心对象序列化的问题了 -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/notes/mail.md: -------------------------------------------------------------------------------- 1 | ## 异步任务 2 | 1. 在启动类上加一个注解`@EnableAsync`,开启异步任务 3 | 2. 在service业务层的方法上加一个`Async`注解,这个方法就成了异步任务 4 | 5 | 6 | ## 邮件任务 7 | 1. 将QQ邮箱的 `POP3/SMTP` 服务开启,获取到邮箱密码 8 | 2. 引入依赖 9 | 3. 在yml配置文件中加入 用户名,密码,主机 以及加密的配置 10 | 4. 将方法封装在工具类中,使用的时候调用相应的方法即可 11 | 12 | 13 | ## 定时任务 14 | 1. 在启动类上加一个注解`@EnableScheduling` ,开启定时任务的注解, 15 | 2. 在业务层的方法上加上`@Scheduled`注解,在注解中写`cron`表达式即可在规定时刻开始任务 16 | 3. 网上有`cron`表达式生成器https://www.matools.com/cron/ -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/notes/mybatis-plus.md: -------------------------------------------------------------------------------- 1 | ## 整合mybatisplus 2 | 1. 导入依赖mybatis-spring-boot-starter 3 | 2. 连接上数据库 4 | -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/realm/AccountRealm.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.realm; 2 | 3 | import com.daq.springboot.demo.pojo.Account; 4 | import com.daq.springboot.demo.service.AccountService; 5 | import org.apache.shiro.SecurityUtils; 6 | import org.apache.shiro.authc.*; 7 | import org.apache.shiro.authz.AuthorizationInfo; 8 | import org.apache.shiro.authz.SimpleAuthorizationInfo; 9 | import org.apache.shiro.realm.AuthorizingRealm; 10 | import org.apache.shiro.subject.PrincipalCollection; 11 | import org.apache.shiro.subject.Subject; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import java.util.HashSet; 14 | import java.util.Set; 15 | 16 | /** 17 | * @author daq 18 | * @description 这是shiro的认证和授权规则,必须继承 AuthorizingRealm类 19 | */ 20 | public class AccountRealm extends AuthorizingRealm { 21 | 22 | @Autowired 23 | private AccountService accountService; 24 | 25 | //先认证 26 | @Override 27 | protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authenticationToken) throws AuthenticationException { 28 | //客户端传过来的对象和密码,自动封装在token中, 29 | UsernamePasswordToken token = (UsernamePasswordToken) authenticationToken; 30 | //根据用户名进行查询,并且判断 31 | Account account = accountService.findByUsername(token.getUsername()); 32 | if (account != null){ 33 | //用户名不为空,继续验证密码 34 | return new SimpleAuthenticationInfo(account,account.getPassword(),getName()); 35 | } 36 | //用户名为空,直接跳出验证 37 | return null; 38 | } 39 | 40 | //再授权 41 | @Override 42 | protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) { 43 | //获取当前用户邓登陆的信息 44 | Subject subject = SecurityUtils.getSubject(); 45 | Account account = (Account) subject.getPrincipal(); 46 | 47 | //设置角色 48 | Set roles = new HashSet<>(); 49 | roles.add(account.getRole()); 50 | SimpleAuthorizationInfo info = new SimpleAuthorizationInfo(roles); 51 | 52 | //设置权限 53 | info.addStringPermission(account.getPerms()); 54 | return info; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/utils/BufferedImageLuminanceSource.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.utils; 2 | 3 | import com.google.zxing.LuminanceSource; 4 | 5 | import java.awt.*; 6 | import java.awt.geom.AffineTransform; 7 | import java.awt.image.BufferedImage; 8 | 9 | /** 10 | * @program: Springboot 11 | * @description: 二维码工具类 12 | * @author: Daq 13 | * @create: 2020-07-28 08:45 14 | **/ 15 | public class BufferedImageLuminanceSource extends LuminanceSource { 16 | 17 | private final BufferedImage image; 18 | private final int left; 19 | private final int top; 20 | 21 | public BufferedImageLuminanceSource(BufferedImage image) { 22 | this(image, 0, 0, image.getWidth(), image.getHeight()); 23 | } 24 | 25 | public BufferedImageLuminanceSource(BufferedImage image, int left, int top, int width, int height) { 26 | super(width, height); 27 | 28 | int sourceWidth = image.getWidth(); 29 | int sourceHeight = image.getHeight(); 30 | if (left + width > sourceWidth || top + height > sourceHeight) { 31 | throw new IllegalArgumentException("Crop rectangle does not fit within image data."); 32 | } 33 | 34 | for (int y = top; y < top + height; y++) { 35 | for (int x = left; x < left + width; x++) { 36 | if ((image.getRGB(x, y) & 0xFF000000) == 0) { 37 | image.setRGB(x, y, 0xFFFFFFFF); // = white 38 | } 39 | } 40 | } 41 | 42 | this.image = new BufferedImage(sourceWidth, sourceHeight, BufferedImage.TYPE_BYTE_GRAY); 43 | this.image.getGraphics().drawImage(image, 0, 0, null); 44 | this.left = left; 45 | this.top = top; 46 | } 47 | 48 | @Override 49 | public byte[] getRow(int y, byte[] row) { 50 | if (y < 0 || y >= getHeight()) { 51 | throw new IllegalArgumentException("Requested row is outside the image: " + y); 52 | } 53 | int width = getWidth(); 54 | if (row == null || row.length < width) { 55 | row = new byte[width]; 56 | } 57 | image.getRaster().getDataElements(left, top + y, width, 1, row); 58 | return row; 59 | } 60 | 61 | @Override 62 | public byte[] getMatrix() { 63 | int width = getWidth(); 64 | int height = getHeight(); 65 | int area = width * height; 66 | byte[] matrix = new byte[area]; 67 | image.getRaster().getDataElements(left, top, width, height, matrix); 68 | return matrix; 69 | } 70 | 71 | @Override 72 | public boolean isCropSupported() { 73 | return true; 74 | } 75 | 76 | @Override 77 | public LuminanceSource crop(int left, int top, int width, int height) { 78 | return new BufferedImageLuminanceSource(image, this.left + left, this.top + top, width, height); 79 | } 80 | 81 | @Override 82 | public boolean isRotateSupported() { 83 | return true; 84 | } 85 | 86 | @Override 87 | public LuminanceSource rotateCounterClockwise() { 88 | int sourceWidth = image.getWidth(); 89 | int sourceHeight = image.getHeight(); 90 | AffineTransform transform = new AffineTransform(0.0, -1.0, 1.0, 0.0, 0.0, sourceWidth); 91 | BufferedImage rotatedImage = new BufferedImage(sourceHeight, sourceWidth, BufferedImage.TYPE_BYTE_GRAY); 92 | Graphics2D g = rotatedImage.createGraphics(); 93 | g.drawImage(image, transform, null); 94 | g.dispose(); 95 | int width = getWidth(); 96 | return new BufferedImageLuminanceSource(rotatedImage, top, sourceWidth - (left + width), getHeight(), width); 97 | } 98 | 99 | } -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/utils/MailUtil.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.utils; 2 | 3 | import org.springframework.mail.SimpleMailMessage; 4 | import org.springframework.mail.javamail.MimeMessageHelper; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * @program: Springboot 9 | * @description: 发送邮件 10 | * @author: Daq 11 | * @create: 2020-07-29 14:03 12 | **/ 13 | @Component 14 | public interface MailUtil { 15 | /** 16 | * 发送文本 17 | * @param subject 主题 18 | * @param content 内容 19 | * @param toWho 需要发送的人 20 | * @param ccPeoples 需要抄送的人 21 | * @param bccPeoples 需要密送的人 22 | * @param attachments 需要附带的附件 23 | */ 24 | void sendSimpleTextMailActual(String subject,String content,String[] toWho,String[] ccPeoples,String[] bccPeoples,String[] attachments); 25 | 26 | /** 27 | * 发送Html 28 | * @param subject 主题 29 | * @param content 内容 30 | * @param toWho 需要发送的人 31 | */ 32 | void sendHtmlMail(String subject,String content,String[] toWho); 33 | 34 | /** 35 | * 处理二进制邮件的基本信息,比如需要带附件的文本邮件、HTML文件、图片邮件、模板邮件等等 36 | * @param mimeMessageHelper:二进制文件的包装类 37 | * @param subject:邮件主题 38 | * @param content:邮件内容 39 | * @param toWho:收件人 40 | * @param ccPeoples:抄送人 41 | * @param bccPeoples:暗送人 42 | * @param isHtml:是否是HTML文件,用于区分带附件的简单文本邮件和真正的HTML文件 43 | * @return :返回这个过程中是否出现异常,当出现异常时会取消邮件的发送 44 | */ 45 | boolean handleBasicInfo(MimeMessageHelper mimeMessageHelper, String subject, String content, String[] toWho, String[] ccPeoples, String[] bccPeoples, boolean isHtml); 46 | 47 | /** 48 | * 用于填充简单文本邮件的基本信息 49 | * @param simpleMailMessage:文本邮件信息对象 50 | * @param subject:邮件主题 51 | * @param content:邮件内容 52 | * @param toWho:收件人 53 | * @param ccPeoples:抄送人 54 | * @param bccPeoples:暗送人 55 | */ 56 | void handleBasicInfo(SimpleMailMessage simpleMailMessage, String subject, String content, String[] toWho, String[] ccPeoples, String[] bccPeoples); 57 | 58 | /** 59 | * 发送html 60 | * @param subject:邮件主题 61 | * @param content:邮件内容 62 | * @param toWho:收件人 63 | * @param mimeMessageHelper:二进制文件的包装类 64 | */ 65 | void handleBasicInfo(MimeMessageHelper mimeMessageHelper,String subject, String content, String[] toWho); 66 | 67 | /** 68 | * 用于处理附件信息,附件需要 MimeMessage 对象 69 | * @param mimeMessageHelper:处理附件的信息对象 70 | * @param subject:邮件的主题,用于日志记录 71 | * @param attachmentFilePaths:附件文件的路径,该路径要求可以定位到本机的一个资源 72 | */ 73 | void handleAttachment(MimeMessageHelper mimeMessageHelper,String subject,String[] attachmentFilePaths); 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/utils/MailUtilImpl.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.utils; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.beans.factory.annotation.Value; 6 | import org.springframework.core.io.FileSystemResource; 7 | import org.springframework.mail.SimpleMailMessage; 8 | import org.springframework.mail.javamail.JavaMailSender; 9 | import org.springframework.mail.javamail.MimeMessageHelper; 10 | import org.springframework.stereotype.Component; 11 | import org.thymeleaf.TemplateEngine; 12 | import javax.mail.MessagingException; 13 | import javax.mail.internet.MimeMessage; 14 | import java.io.File; 15 | 16 | /** 17 | * @program: Springboot 18 | * @description: 发送邮件功能具体实现类 19 | * @author: Daq 20 | * @create: 2020-07-29 14:04 21 | **/ 22 | 23 | @Component 24 | @Slf4j 25 | @SuppressWarnings("all") 26 | public class MailUtilImpl implements MailUtil { 27 | 28 | //默认编码 29 | public static final String DEFAULT_ENCODING = "UTF-8"; 30 | 31 | //本身邮件的发送者,来自邮件配置 32 | @Value("${spring.mail.username}") 33 | private String userName; 34 | @Value("${spring.mail.nickname}") 35 | private String nickname; 36 | 37 | //模板引擎解析对象,用于解析模板 38 | @Autowired 39 | private TemplateEngine templateEngine; 40 | 41 | @Autowired(required = false) 42 | private JavaMailSender mailSender; 43 | 44 | @Override 45 | public void sendSimpleTextMailActual(String subject,String content,String[] toWho,String[] ccPeoples,String[] bccPeoples,String[] attachments){ 46 | //检验参数:邮件主题、收件人、邮件内容必须不为空才能够保证基本的逻辑执行 47 | if(subject == null||toWho == null||toWho.length == 0||content == null){ 48 | log.error("邮件-> {} 无法继续执行,因为缺少基本的参数:邮件主题、收件人、邮件内容",subject); 49 | throw new RuntimeException("模板邮件无法继续发送,因为缺少必要的参数!"); 50 | } 51 | log.info("开始发送简单文本邮件:主题->{},收件人->{},抄送人->{},密送人->{},附件->{}",subject,toWho,ccPeoples,bccPeoples,attachments); 52 | 53 | //附件处理,需要处理附件时,需要使用二进制信息,使用 MimeMessage 类来进行处理 54 | if(attachments != null&&attachments.length > 0){ 55 | try{ 56 | //附件处理需要进行二进制传输 57 | MimeMessage mimeMessage = mailSender.createMimeMessage(); 58 | MimeMessageHelper helper = new MimeMessageHelper(mimeMessage,true,DEFAULT_ENCODING); 59 | //设置邮件的基本信息:这些函数都会在后面列出来 60 | boolean continueProcess = handleBasicInfo(helper,subject,content,toWho,ccPeoples,bccPeoples,false); 61 | //如果处理基本信息出现错误 62 | if(!continueProcess){ 63 | log.error("邮件基本信息出错: 主题->{}",subject); 64 | return; 65 | } 66 | //处理附件 67 | handleAttachment(helper,subject,attachments); 68 | //发送该邮件 69 | mailSender.send(mimeMessage); 70 | log.info("发送邮件成功: 主题->{}",subject); 71 | } catch (MessagingException e) { 72 | e.printStackTrace(); 73 | log.error("发送邮件失败: 主题->{}",subject); 74 | 75 | } 76 | }else{ 77 | //创建一个简单邮件信息对象 78 | SimpleMailMessage simpleMailMessage = new SimpleMailMessage(); 79 | //设置邮件的基本信息 80 | handleBasicInfo(simpleMailMessage,subject,content,toWho,ccPeoples,bccPeoples); 81 | //发送邮件 82 | mailSender.send(simpleMailMessage); 83 | log.info("发送邮件成功: 主题->{}",subject,toWho,ccPeoples,bccPeoples,attachments); 84 | } 85 | } 86 | 87 | @Override 88 | public void sendHtmlMail(String subject, String content, String[] toWho) { 89 | 90 | //检验参数:邮件主题、收件人、邮件内容必须不为空才能够保证基本的逻辑执行 91 | if(subject == null||toWho == null||toWho.length == 0||content == null){ 92 | log.error("邮件-> {} 无法继续执行,因为缺少基本的参数:邮件主题、收件人、邮件内容",subject); 93 | throw new RuntimeException("模板邮件无法继续发送,因为缺少必要的参数!"); 94 | } 95 | log.info("开始发送Html邮件:主题->{},收件人->{}",subject,toWho); 96 | //html 97 | MimeMessage mimeMessage = mailSender.createMimeMessage(); 98 | try { 99 | MimeMessageHelper helper = new MimeMessageHelper(mimeMessage,true,DEFAULT_ENCODING); 100 | //设置邮件的基本信息 101 | handleBasicInfo(helper,subject,content,toWho); 102 | //发送邮件 103 | mailSender.send(mimeMessage); 104 | log.info("html邮件发送成功"); 105 | } catch (MessagingException e) { 106 | log.error("发送邮件出错->{}",subject); 107 | } 108 | log.info("发送邮件成功: 主题->{}",subject,toWho); 109 | } 110 | 111 | @Override 112 | public boolean handleBasicInfo(MimeMessageHelper mimeMessageHelper,String subject,String content,String[] toWho,String[] ccPeoples,String[] bccPeoples,boolean isHtml){ 113 | try{ 114 | //设置必要的邮件元素 115 | //设置发件人 116 | mimeMessageHelper.setFrom(nickname+'<'+userName+'>'); 117 | //设置邮件的主题 118 | mimeMessageHelper.setSubject(subject); 119 | //设置邮件的内容,区别是否是HTML邮件 120 | mimeMessageHelper.setText(content,isHtml); 121 | //设置邮件的收件人 122 | mimeMessageHelper.setTo(toWho); 123 | //设置非必要的邮件元素,在使用helper进行封装时,这些数据都不能够为空 124 | if(ccPeoples != null) { 125 | //设置邮件的抄送人:MimeMessageHelper # Assert.notNull(cc, "Cc address array must not be null"); 126 | mimeMessageHelper.setCc(ccPeoples); 127 | } 128 | if(bccPeoples != null) { 129 | //设置邮件的密送人:MimeMessageHelper # Assert.notNull(bcc, "Bcc address array must not be null"); 130 | mimeMessageHelper.setBcc(bccPeoples); 131 | } 132 | return true; 133 | }catch(MessagingException e){ 134 | e.printStackTrace(); 135 | log.error("邮件基本信息出错->{}",subject); 136 | } 137 | return false; 138 | } 139 | 140 | @Override 141 | public void handleBasicInfo(SimpleMailMessage simpleMailMessage,String subject,String content,String[] toWho,String[] ccPeoples,String[] bccPeoples){ 142 | //设置发件人 143 | simpleMailMessage.setFrom(nickname+'<'+userName+'>'); 144 | //设置邮件的主题 145 | simpleMailMessage.setSubject(subject); 146 | //设置邮件的内容 147 | simpleMailMessage.setText(content); 148 | //设置邮件的收件人 149 | simpleMailMessage.setTo(toWho); 150 | //设置邮件的抄送人 151 | simpleMailMessage.setCc(ccPeoples); 152 | //设置邮件的密送人 153 | simpleMailMessage.setBcc(bccPeoples); 154 | } 155 | 156 | @Override 157 | public void handleBasicInfo(MimeMessageHelper mimeMessageHelper,String subject,String content,String[] toWho){ 158 | try { 159 | //设置发件人 160 | mimeMessageHelper.setFrom(nickname+'<'+userName+'>'); 161 | //设置邮件的主题 162 | mimeMessageHelper.setSubject(subject); 163 | //设置邮件的内容 164 | mimeMessageHelper.setText(content,true); 165 | //设置邮件的收件人 166 | mimeMessageHelper.setTo(toWho); 167 | } catch (MessagingException e) { 168 | log.error("html邮件基本信息出错->{}",subject); 169 | } 170 | } 171 | 172 | @Override 173 | public void handleAttachment(MimeMessageHelper mimeMessageHelper,String subject,String[] attachmentFilePaths){ 174 | //判断是否需要处理邮件的附件 175 | if(attachmentFilePaths != null&&attachmentFilePaths.length > 0) { 176 | FileSystemResource resource; 177 | String fileName; 178 | //循环处理邮件的附件 179 | for (String attachmentFilePath : attachmentFilePaths) { 180 | //获取该路径所对应的文件资源对象 181 | resource = new FileSystemResource(new File(attachmentFilePath)); 182 | //判断该资源是否存在,当不存在时仅仅会打印一条警告日志,不会中断处理程序。 183 | // 也就是说在附件出现异常的情况下,邮件是可以正常发送的,所以请确定你发送的邮件附件在本机存在 184 | if (!resource.exists()) { 185 | log.warn("邮件->{} 的附件->{} 不存在!", subject, attachmentFilePath); 186 | //开启下一个资源的处理 187 | continue; 188 | } 189 | //获取资源的名称 190 | fileName = resource.getFilename(); 191 | try { 192 | //添加附件 193 | mimeMessageHelper.addAttachment(fileName, resource); 194 | } catch (MessagingException e) { 195 | e.printStackTrace(); 196 | log.error("邮件->{} 添加附件->{} 出现异常->{}", subject, attachmentFilePath, e.getMessage()); 197 | } 198 | } 199 | } 200 | } 201 | } 202 | 203 | 204 | -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/utils/QRCodeUtil.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.utils; 2 | 3 | import java.awt.BasicStroke; 4 | import java.awt.Graphics; 5 | import java.awt.Graphics2D; 6 | import java.awt.Image; 7 | import java.awt.Shape; 8 | import java.awt.geom.RoundRectangle2D; 9 | import java.awt.image.BufferedImage; 10 | import java.io.File; 11 | import java.io.OutputStream; 12 | import java.util.Hashtable; 13 | import javax.imageio.ImageIO; 14 | 15 | import com.google.zxing.BarcodeFormat; 16 | import com.google.zxing.BinaryBitmap; 17 | import com.google.zxing.DecodeHintType; 18 | import com.google.zxing.EncodeHintType; 19 | import com.google.zxing.MultiFormatReader; 20 | import com.google.zxing.MultiFormatWriter; 21 | import com.google.zxing.Result; 22 | import com.google.zxing.common.BitMatrix; 23 | import com.google.zxing.common.HybridBinarizer; 24 | import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; 25 | 26 | /** 27 | * @program: Springboot 28 | * @description: 可以修改一些参数,例如二维码的尺寸,宽高等等。 29 | * @author: Daq 30 | * @create: 2020-07-28 08:46 31 | **/ 32 | 33 | @SuppressWarnings("all") 34 | public class QRCodeUtil { 35 | 36 | public static void shengcheng(String text,String destPath) throws Exception { 37 | // text: 存放在二维码中的内容,二维码中的内容可以是文字,可以是链接等 38 | // destPath: 生成的二维码的路径及名称 39 | // 如:G:\\LogFile\\daq.jpg 40 | 41 | //生成二维码 42 | QRCodeUtil.encode(text, null, destPath, true); 43 | // 解析二维码 44 | String str = QRCodeUtil.decode(destPath); 45 | // 打印出解析出的内容 46 | System.out.println(str); 47 | } 48 | 49 | public static void shengcheng(String text,String imgPath,String destPath) throws Exception { 50 | // text: 存放在二维码中的内容,二维码中的内容可以是文字,可以是链接等 51 | // destPath: 生成的二维码的路径及名称 52 | // imgPath: 嵌入二维码的图片路径 53 | 54 | //生成二维码 55 | QRCodeUtil.encode(text, null, destPath, true); 56 | // 解析二维码 57 | String str = QRCodeUtil.decode(destPath); 58 | // 打印出解析出的内容 59 | System.out.println(str); 60 | } 61 | 62 | private static final String CHARSET = "utf-8"; 63 | private static final String FORMAT_NAME = "JPG"; 64 | // 二维码尺寸 65 | private static final int QRCODE_SIZE = 300; 66 | // LOGO宽度 67 | private static final int WIDTH = 60; 68 | // LOGO高度 69 | private static final int HEIGHT = 60; 70 | 71 | private static BufferedImage createImage(String content, String imgPath, boolean needCompress) throws Exception { 72 | Hashtable hints = new Hashtable(); 73 | hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); 74 | hints.put(EncodeHintType.CHARACTER_SET, CHARSET); 75 | hints.put(EncodeHintType.MARGIN, 1); 76 | BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, QRCODE_SIZE, QRCODE_SIZE, 77 | hints); 78 | int width = bitMatrix.getWidth(); 79 | int height = bitMatrix.getHeight(); 80 | BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); 81 | for (int x = 0; x < width; x++) { 82 | for (int y = 0; y < height; y++) { 83 | image.setRGB(x, y, bitMatrix.get(x, y) ? 0xFF000000 : 0xFFFFFFFF); 84 | } 85 | } 86 | if (imgPath == null || "".equals(imgPath)) { 87 | return image; 88 | } 89 | // 插入图片 90 | QRCodeUtil.insertImage(image, imgPath, needCompress); 91 | return image; 92 | } 93 | 94 | private static void insertImage(BufferedImage source, String imgPath, boolean needCompress) throws Exception { 95 | File file = new File(imgPath); 96 | if (!file.exists()) { 97 | System.err.println("" + imgPath + " 该文件不存在!"); 98 | return; 99 | } 100 | Image src = ImageIO.read(new File(imgPath)); 101 | int width = src.getWidth(null); 102 | int height = src.getHeight(null); 103 | if (needCompress) { // 压缩LOGO 104 | if (width > WIDTH) { 105 | width = WIDTH; 106 | } 107 | if (height > HEIGHT) { 108 | height = HEIGHT; 109 | } 110 | Image image = src.getScaledInstance(width, height, Image.SCALE_SMOOTH); 111 | BufferedImage tag = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); 112 | Graphics g = tag.getGraphics(); 113 | g.drawImage(image, 0, 0, null); // 绘制缩小后的图 114 | g.dispose(); 115 | src = image; 116 | } 117 | // 插入LOGO 118 | Graphics2D graph = source.createGraphics(); 119 | int x = (QRCODE_SIZE - width) / 2; 120 | int y = (QRCODE_SIZE - height) / 2; 121 | graph.drawImage(src, x, y, width, height, null); 122 | Shape shape = new RoundRectangle2D.Float(x, y, width, width, 6, 6); 123 | graph.setStroke(new BasicStroke(3f)); 124 | graph.draw(shape); 125 | graph.dispose(); 126 | } 127 | 128 | private static void encode(String content, String imgPath, String destPath, boolean needCompress) throws Exception { 129 | BufferedImage image = QRCodeUtil.createImage(content, imgPath, needCompress); 130 | mkdirs(destPath); 131 | // String file = new Random().nextInt(99999999)+".jpg"; 132 | // ImageIO.write(image, FORMAT_NAME, new File(destPath+"/"+file)); 133 | ImageIO.write(image, FORMAT_NAME, new File(destPath)); 134 | } 135 | 136 | private static BufferedImage encode(String content, String imgPath, boolean needCompress) throws Exception { 137 | BufferedImage image = QRCodeUtil.createImage(content, imgPath, needCompress); 138 | return image; 139 | } 140 | 141 | private static void mkdirs(String destPath) { 142 | File file = new File(destPath); 143 | // 当文件夹不存在时,mkdirs会自动创建多层目录,区别于mkdir.(mkdir如果父目录不存在则会抛出异常) 144 | if (!file.exists() && !file.isDirectory()) { 145 | file.mkdirs(); 146 | } 147 | } 148 | 149 | private static void encode(String content, String imgPath, String destPath) throws Exception { 150 | QRCodeUtil.encode(content, imgPath, destPath, false); 151 | } 152 | // 被注释的方法 153 | /* 154 | * public static void encode(String content, String destPath, boolean 155 | * needCompress) throws Exception { QRCodeUtil.encode(content, null, destPath, 156 | * needCompress); } 157 | */ 158 | 159 | private static void encode(String content, String destPath) throws Exception { 160 | QRCodeUtil.encode(content, null, destPath, false); 161 | } 162 | 163 | private static void encode(String content, String imgPath, OutputStream output, boolean needCompress) 164 | throws Exception { 165 | BufferedImage image = QRCodeUtil.createImage(content, imgPath, needCompress); 166 | ImageIO.write(image, FORMAT_NAME, output); 167 | } 168 | 169 | private static void encode(String content, OutputStream output) throws Exception { 170 | QRCodeUtil.encode(content, null, output, false); 171 | } 172 | 173 | private static String decode(File file) throws Exception { 174 | BufferedImage image; 175 | image = ImageIO.read(file); 176 | if (image == null) { 177 | return null; 178 | } 179 | BufferedImageLuminanceSource source = new BufferedImageLuminanceSource(image); 180 | BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source)); 181 | Result result; 182 | Hashtable hints = new Hashtable(); 183 | hints.put(DecodeHintType.CHARACTER_SET, CHARSET); 184 | result = new MultiFormatReader().decode(bitmap, hints); 185 | String resultStr = result.getText(); 186 | return resultStr; 187 | } 188 | 189 | private static String decode(String path) throws Exception { 190 | return QRCodeUtil.decode(new File(path)); 191 | } 192 | 193 | } 194 | -------------------------------------------------------------------------------- /src/main/java/com/daq/springboot/utils/VerifyUtil.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.utils; 2 | 3 | import javax.imageio.ImageIO; 4 | import java.awt.*; 5 | import java.awt.image.BufferedImage; 6 | import java.io.FileOutputStream; 7 | import java.io.IOException; 8 | import java.io.OutputStream; 9 | import java.util.Random; 10 | 11 | /** 12 | * @program: Springboot 13 | * @description: 图片验证码工具类 14 | * @author: Daq 15 | * @create: 2020-08-15 08:27 16 | **/ 17 | 18 | public final class VerifyUtil { 19 | 20 | // 验证码字符集 21 | private static final char[] chars = { 22 | '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 23 | 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 24 | 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}; 25 | // 字符数量 26 | private static final int SIZE = 4; 27 | // 干扰线数量 28 | private static final int LINES = 10; 29 | // 宽度 30 | private static final int WIDTH = 100; 31 | // 高度 32 | private static final int HEIGHT = 32; 33 | // 字体大小 34 | private static final int FONT_SIZE = 20; 35 | 36 | /** 37 | * 生成随机验证码及图片 38 | * 数组中[验证码,图片] 39 | */ 40 | public static Object[] createImage() { 41 | StringBuffer sb = new StringBuffer(); 42 | // 1.创建空白图片 43 | BufferedImage image = new BufferedImage( 44 | WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB); 45 | // 2.获取图片画笔 46 | Graphics graphic = image.getGraphics(); 47 | // 3.设置画笔颜色 48 | graphic.setColor(Color.LIGHT_GRAY); 49 | // 4.绘制矩形背景 50 | graphic.fillRect(0, 0, WIDTH, HEIGHT); 51 | // 5.画随机字符 52 | Random ran = new Random(); 53 | for (int i = 0; i log4j.appender.MAIL.From=2829025551@qq.com 39 | log4j.appender.MAIL.SMTPHost=www.wusetu.com 40 | log4j.appender.MAIL.Subject=Log4J Message 41 | www.wusetu.com ">log4j.appender.MAIL.To=2829025551@qq.com 42 | log4j.appender.MAIL.layout=org.apache.log4j.PatternLayout 43 | log4j.appender.MAIL.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n 44 | 45 | -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/layui.mobile.css: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | blockquote,body,button,dd,div,dl,dt,form,h1,h2,h3,h4,h5,h6,input,legend,li,ol,p,td,textarea,th,ul{margin:0;padding:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}html{font:12px 'Helvetica Neue','PingFang SC',STHeitiSC-Light,Helvetica,Arial,sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}a,button,input{-webkit-tap-highlight-color:rgba(255,0,0,0)}a{text-decoration:none;background:0 0}a:active,a:hover{outline:0}table{border-collapse:collapse;border-spacing:0}li{list-style:none}b,strong{font-weight:700}h1,h2,h3,h4,h5,h6{font-weight:500}address,cite,dfn,em,var{font-style:normal}dfn{font-style:italic}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}img{border:0;vertical-align:bottom}.layui-inline,input,label{vertical-align:middle}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0;outline:0}button,select{text-transform:none}select{-webkit-appearance:none;border:none}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}@font-face{font-family:layui-icon;src:url(../font/iconfont.eot?v=1.0.7);src:url(../font/iconfont.eot?v=1.0.7#iefix) format('embedded-opentype'),url(../font/iconfont.woff?v=1.0.7) format('woff'),url(../font/iconfont.ttf?v=1.0.7) format('truetype'),url(../font/iconfont.svg?v=1.0.7#iconfont) format('svg')}.layui-icon{font-family:layui-icon!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.layui-box,.layui-box *{-webkit-box-sizing:content-box!important;-moz-box-sizing:content-box!important;box-sizing:content-box!important}.layui-border-box,.layui-border-box *{-webkit-box-sizing:border-box!important;-moz-box-sizing:border-box!important;box-sizing:border-box!important}.layui-inline{position:relative;display:inline-block;*display:inline;*zoom:1}.layui-edge,.layui-upload-iframe{position:absolute;width:0;height:0}.layui-edge{border-style:dashed;border-color:transparent;overflow:hidden}.layui-elip{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-unselect{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.layui-disabled,.layui-disabled:active{background-color:#d2d2d2!important;color:#fff!important;cursor:not-allowed!important}.layui-circle{border-radius:100%}.layui-show{display:block!important}.layui-hide{display:none!important}.layui-upload-iframe{border:0;visibility:hidden}.layui-upload-enter{border:1px solid #009E94;background-color:#009E94;color:#fff;-webkit-transform:scale(1.1);transform:scale(1.1)}@-webkit-keyframes layui-m-anim-scale{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes layui-m-anim-scale{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}.layui-m-anim-scale{animation-name:layui-m-anim-scale;-webkit-animation-name:layui-m-anim-scale}@-webkit-keyframes layui-m-anim-up{0%{opacity:0;-webkit-transform:translateY(800px);transform:translateY(800px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes layui-m-anim-up{0%{opacity:0;-webkit-transform:translateY(800px);transform:translateY(800px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.layui-m-anim-up{-webkit-animation-name:layui-m-anim-up;animation-name:layui-m-anim-up}@-webkit-keyframes layui-m-anim-left{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}100%{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes layui-m-anim-left{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}100%{-webkit-transform:translateX(0);transform:translateX(0)}}.layui-m-anim-left{-webkit-animation-name:layui-m-anim-left;animation-name:layui-m-anim-left}@-webkit-keyframes layui-m-anim-right{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}100%{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes layui-m-anim-right{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}100%{-webkit-transform:translateX(0);transform:translateX(0)}}.layui-m-anim-right{-webkit-animation-name:layui-m-anim-right;animation-name:layui-m-anim-right}@-webkit-keyframes layui-m-anim-lout{0%{-webkit-transform:translateX(0);transform:translateX(0)}100%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}}@keyframes layui-m-anim-lout{0%{-webkit-transform:translateX(0);transform:translateX(0)}100%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}}.layui-m-anim-lout{-webkit-animation-name:layui-m-anim-lout;animation-name:layui-m-anim-lout}@-webkit-keyframes layui-m-anim-rout{0%{-webkit-transform:translateX(0);transform:translateX(0)}100%{-webkit-transform:translateX(100%);transform:translateX(100%)}}@keyframes layui-m-anim-rout{0%{-webkit-transform:translateX(0);transform:translateX(0)}100%{-webkit-transform:translateX(100%);transform:translateX(100%)}}.layui-m-anim-rout{-webkit-animation-name:layui-m-anim-rout;animation-name:layui-m-anim-rout}.layui-m-layer{position:relative;z-index:19891014}.layui-m-layer *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.layui-m-layermain,.layui-m-layershade{position:fixed;left:0;top:0;width:100%;height:100%}.layui-m-layershade{background-color:rgba(0,0,0,.7);pointer-events:auto}.layui-m-layermain{display:table;font-family:Helvetica,arial,sans-serif;pointer-events:none}.layui-m-layermain .layui-m-layersection{display:table-cell;vertical-align:middle;text-align:center}.layui-m-layerchild{position:relative;display:inline-block;text-align:left;background-color:#fff;font-size:14px;border-radius:5px;box-shadow:0 0 8px rgba(0,0,0,.1);pointer-events:auto;-webkit-overflow-scrolling:touch;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.2s;animation-duration:.2s}.layui-m-layer0 .layui-m-layerchild{width:90%;max-width:640px}.layui-m-layer1 .layui-m-layerchild{border:none;border-radius:0}.layui-m-layer2 .layui-m-layerchild{width:auto;max-width:260px;min-width:40px;border:none;background:0 0;box-shadow:none;color:#fff}.layui-m-layerchild h3{padding:0 10px;height:60px;line-height:60px;font-size:16px;font-weight:400;border-radius:5px 5px 0 0;text-align:center}.layui-m-layerbtn span,.layui-m-layerchild h3{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-m-layercont{padding:50px 30px;line-height:22px;text-align:center}.layui-m-layer1 .layui-m-layercont{padding:0;text-align:left}.layui-m-layer2 .layui-m-layercont{text-align:center;padding:0;line-height:0}.layui-m-layer2 .layui-m-layercont i{width:25px;height:25px;margin-left:8px;display:inline-block;background-color:#fff;border-radius:100%;-webkit-animation:layui-m-anim-loading 1.4s infinite ease-in-out;animation:layui-m-anim-loading 1.4s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.layui-m-layerbtn,.layui-m-layerbtn span{position:relative;text-align:center;border-radius:0 0 5px 5px}.layui-m-layer2 .layui-m-layercont p{margin-top:20px}@-webkit-keyframes layui-m-anim-loading{0%,100%,80%{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}}@keyframes layui-m-anim-loading{0%,100%,80%{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}}.layui-m-layer2 .layui-m-layercont i:first-child{margin-left:0;-webkit-animation-delay:-.32s;animation-delay:-.32s}.layui-m-layer2 .layui-m-layercont i.layui-m-layerload{-webkit-animation-delay:-.16s;animation-delay:-.16s}.layui-m-layer2 .layui-m-layercont>div{line-height:22px;padding-top:7px;margin-bottom:20px;font-size:14px}.layui-m-layerbtn{display:box;display:-moz-box;display:-webkit-box;width:100%;height:50px;line-height:50px;font-size:0;border-top:1px solid #D0D0D0;background-color:#F2F2F2}.layui-m-layerbtn span{display:block;-moz-box-flex:1;box-flex:1;-webkit-box-flex:1;font-size:14px;cursor:pointer}.layui-m-layerbtn span[yes]{color:#40AFFE}.layui-m-layerbtn span[no]{border-right:1px solid #D0D0D0;border-radius:0 0 0 5px}.layui-m-layerbtn span:active{background-color:#F6F6F6}.layui-m-layerend{position:absolute;right:7px;top:10px;width:30px;height:30px;border:0;font-weight:400;background:0 0;cursor:pointer;-webkit-appearance:none;font-size:30px}.layui-m-layerend::after,.layui-m-layerend::before{position:absolute;left:5px;top:15px;content:'';width:18px;height:1px;background-color:#999;transform:rotate(45deg);-webkit-transform:rotate(45deg);border-radius:3px}.layui-m-layerend::after{transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}body .layui-m-layer .layui-m-layer-footer{position:fixed;width:95%;max-width:100%;margin:0 auto;left:0;right:0;bottom:10px;background:0 0}.layui-m-layer-footer .layui-m-layercont{padding:20px;border-radius:5px 5px 0 0;background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn{display:block;height:auto;background:0 0;border-top:none}.layui-m-layer-footer .layui-m-layerbtn span{background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn span[no]{color:#FD482C;border-top:1px solid #c2c2c2;border-radius:0 0 5px 5px}.layui-m-layer-footer .layui-m-layerbtn span[yes]{margin-top:10px;border-radius:5px}body .layui-m-layer .layui-m-layer-msg{width:auto;max-width:90%;margin:0 auto;bottom:-150px;background-color:rgba(0,0,0,.7);color:#fff}.layui-m-layer-msg .layui-m-layercont{padding:10px 20px} -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/code.css: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none} -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/laydate/default/laydate.css: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | .laydate-set-ym,.layui-laydate,.layui-laydate *,.layui-laydate-list{box-sizing:border-box}html #layuicss-laydate{display:none;position:absolute;width:1989px}.layui-laydate *{margin:0;padding:0}.layui-laydate{position:absolute;z-index:66666666;margin:5px 0;border-radius:2px;font-size:14px;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-name:laydate-upbit;animation-name:laydate-upbit}.layui-laydate-main{width:272px}.layui-laydate-content td,.layui-laydate-header *,.layui-laydate-list li{transition-duration:.3s;-webkit-transition-duration:.3s}@-webkit-keyframes laydate-upbit{from{-webkit-transform:translate3d(0,20px,0);opacity:.3}to{-webkit-transform:translate3d(0,0,0);opacity:1}}@keyframes laydate-upbit{from{transform:translate3d(0,20px,0);opacity:.3}to{transform:translate3d(0,0,0);opacity:1}}.layui-laydate-static{position:relative;z-index:0;display:inline-block;margin:0;-webkit-animation:none;animation:none}.laydate-ym-show .laydate-next-m,.laydate-ym-show .laydate-prev-m{display:none!important}.laydate-ym-show .laydate-next-y,.laydate-ym-show .laydate-prev-y{display:inline-block!important}.laydate-time-show .laydate-set-ym span[lay-type=month],.laydate-time-show .laydate-set-ym span[lay-type=year],.laydate-time-show .layui-laydate-header .layui-icon,.laydate-ym-show .laydate-set-ym span[lay-type=month]{display:none!important}.layui-laydate-header{position:relative;line-height:30px;padding:10px 70px 5px}.laydate-set-ym span,.layui-laydate-header i{padding:0 5px;cursor:pointer}.layui-laydate-header *{display:inline-block;vertical-align:bottom}.layui-laydate-header i{position:absolute;top:10px;color:#999;font-size:18px}.layui-laydate-header i.laydate-prev-y{left:15px}.layui-laydate-header i.laydate-prev-m{left:45px}.layui-laydate-header i.laydate-next-y{right:15px}.layui-laydate-header i.laydate-next-m{right:45px}.laydate-set-ym{width:100%;text-align:center;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.laydate-time-text{cursor:default!important}.layui-laydate-content{position:relative;padding:10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.layui-laydate-content table{border-collapse:collapse;border-spacing:0}.layui-laydate-content td,.layui-laydate-content th{width:36px;height:30px;padding:5px;text-align:center}.layui-laydate-content td{position:relative;cursor:pointer}.laydate-day-mark{position:absolute;left:0;top:0;width:100%;height:100%;line-height:30px;font-size:12px;overflow:hidden}.laydate-day-mark::after{position:absolute;content:'';right:2px;top:2px;width:5px;height:5px;border-radius:50%}.layui-laydate-footer{position:relative;height:46px;line-height:26px;padding:10px 20px}.layui-laydate-footer span{margin-right:15px;display:inline-block;cursor:pointer;font-size:12px}.layui-laydate-footer span:hover{color:#5FB878}.laydate-footer-btns{position:absolute;right:10px;top:10px}.laydate-footer-btns span{height:26px;line-height:26px;margin:0 0 0 -1px;padding:0 10px;border:1px solid #C9C9C9;background-color:#fff;white-space:nowrap;vertical-align:top;border-radius:2px}.layui-laydate-list>li,.layui-laydate-range .layui-laydate-main{display:inline-block;vertical-align:middle}.layui-laydate-list{position:absolute;left:0;top:0;width:100%;height:100%;padding:10px;background-color:#fff}.layui-laydate-list>li{position:relative;width:33.3%;height:36px;line-height:36px;margin:3px 0;text-align:center;cursor:pointer}.laydate-month-list>li{width:25%;margin:17px 0}.laydate-time-list>li{height:100%;margin:0;line-height:normal;cursor:default}.laydate-time-list p{position:relative;top:-4px;line-height:29px}.laydate-time-list ol{height:181px;overflow:hidden}.laydate-time-list>li:hover ol{overflow-y:auto}.laydate-time-list ol li{width:130%;padding-left:33px;line-height:30px;text-align:left;cursor:pointer}.layui-laydate-hint{position:absolute;top:115px;left:50%;width:250px;margin-left:-125px;line-height:20px;padding:15px;text-align:center;font-size:12px}.layui-laydate-range{width:546px}.layui-laydate-range .laydate-main-list-0 .laydate-next-m,.layui-laydate-range .laydate-main-list-0 .laydate-next-y,.layui-laydate-range .laydate-main-list-1 .laydate-prev-m,.layui-laydate-range .laydate-main-list-1 .laydate-prev-y{display:none}.layui-laydate-range .laydate-main-list-1 .layui-laydate-content{border-left:1px solid #e2e2e2}.layui-laydate,.layui-laydate-hint{border:1px solid #d2d2d2;box-shadow:0 2px 4px rgba(0,0,0,.12);background-color:#fff;color:#666}.layui-laydate-header{border-bottom:1px solid #e2e2e2}.layui-laydate-header i:hover,.layui-laydate-header span:hover{color:#5FB878}.layui-laydate-content{border-top:none 0;border-bottom:none 0}.layui-laydate-content th{font-weight:400;color:#333}.layui-laydate-content td{color:#666}.layui-laydate-content td.laydate-selected{background-color:#00F7DE}.laydate-selected:hover{background-color:#00F7DE!important}.layui-laydate-content td:hover,.layui-laydate-list li:hover{background-color:#eaeaea;color:#333}.laydate-time-list li ol{margin:0;padding:0;border:1px solid #e2e2e2;border-left-width:0}.laydate-time-list li:first-child ol{border-left-width:1px}.laydate-time-list>li:hover{background:0 0}.layui-laydate-content .laydate-day-next,.layui-laydate-content .laydate-day-prev{color:#d2d2d2}.laydate-selected.laydate-day-next,.laydate-selected.laydate-day-prev{background-color:#f8f8f8!important}.layui-laydate-footer{border-top:1px solid #e2e2e2}.layui-laydate-hint{color:#FF5722}.laydate-day-mark::after{background-color:#5FB878}.layui-laydate-content td.layui-this .laydate-day-mark::after{display:none}.layui-laydate-footer span[lay-type=date]{color:#5FB878}.layui-laydate .layui-this{background-color:#009688!important;color:#fff!important}.layui-laydate .laydate-disabled,.layui-laydate .laydate-disabled:hover{background:0 0!important;color:#d2d2d2!important;cursor:not-allowed!important;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.laydate-theme-molv{border:none}.laydate-theme-molv.layui-laydate-range{width:548px}.laydate-theme-molv .layui-laydate-main{width:274px}.laydate-theme-molv .layui-laydate-header{border:none;background-color:#009688}.laydate-theme-molv .layui-laydate-header i,.laydate-theme-molv .layui-laydate-header span{color:#f6f6f6}.laydate-theme-molv .layui-laydate-header i:hover,.laydate-theme-molv .layui-laydate-header span:hover{color:#fff}.laydate-theme-molv .layui-laydate-content{border:1px solid #e2e2e2;border-top:none;border-bottom:none}.laydate-theme-molv .laydate-main-list-1 .layui-laydate-content{border-left:none}.laydate-theme-grid .laydate-month-list>li,.laydate-theme-grid .laydate-year-list>li,.laydate-theme-grid .layui-laydate-content td,.laydate-theme-grid .layui-laydate-content thead,.laydate-theme-molv .layui-laydate-footer{border:1px solid #e2e2e2}.laydate-theme-grid .laydate-selected,.laydate-theme-grid .laydate-selected:hover{background-color:#f2f2f2!important;color:#009688!important}.laydate-theme-grid .laydate-selected.laydate-day-next,.laydate-theme-grid .laydate-selected.laydate-day-prev{color:#d2d2d2!important}.laydate-theme-grid .laydate-month-list,.laydate-theme-grid .laydate-year-list{margin:1px 0 0 1px}.laydate-theme-grid .laydate-month-list>li,.laydate-theme-grid .laydate-year-list>li{margin:0 -1px -1px 0}.laydate-theme-grid .laydate-year-list>li{height:43px;line-height:43px}.laydate-theme-grid .laydate-month-list>li{height:71px;line-height:71px} -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/layer/default/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/css/modules/layer/default/icon-ext.png -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/layer/default/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/css/modules/layer/default/icon.png -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/layer/default/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/css/modules/layer/default/loading-0.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/layer/default/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/css/modules/layer/default/loading-1.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/layer/default/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/css/modules/layer/default/loading-2.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/font/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/font/iconfont.eot -------------------------------------------------------------------------------- /src/main/resources/static/layui/font/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/font/iconfont.ttf -------------------------------------------------------------------------------- /src/main/resources/static/layui/font/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/font/iconfont.woff -------------------------------------------------------------------------------- /src/main/resources/static/layui/font/iconfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/font/iconfont.woff2 -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/0.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/1.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/10.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/11.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/12.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/13.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/14.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/15.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/15.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/16.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/17.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/17.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/18.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/18.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/19.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/19.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/2.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/20.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/20.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/21.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/21.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/22.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/22.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/23.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/23.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/24.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/25.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/25.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/26.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/26.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/27.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/27.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/28.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/28.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/29.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/29.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/3.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/30.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/30.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/31.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/31.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/32.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/32.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/33.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/33.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/34.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/34.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/35.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/35.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/36.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/36.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/37.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/37.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/38.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/38.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/39.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/39.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/4.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/40.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/40.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/41.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/41.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/42.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/42.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/43.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/43.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/44.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/44.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/45.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/45.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/46.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/46.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/47.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/47.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/48.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/48.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/49.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/49.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/5.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/50.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/51.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/51.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/52.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/52.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/53.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/53.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/54.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/54.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/55.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/55.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/56.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/56.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/57.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/57.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/58.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/58.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/59.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/59.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/6.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/60.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/60.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/61.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/61.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/62.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/62.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/63.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/63.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/64.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/64.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/65.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/65.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/66.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/66.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/67.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/67.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/68.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/68.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/69.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/69.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/7.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/70.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/70.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/71.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/71.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/8.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/9.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/Starry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DAQ121/Java-Scaffold/791f42aa0a91ebdacadc78c9cbe36771aa396059/src/main/resources/static/layui/images/face/Starry.png -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/carousel.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(clearInterval(e.timer),e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['",'"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['
    ',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("")}),i.join("")}(),"
"].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a/g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('
  1. '+o.replace(/[\r\t\n]+/g,"
  2. ")+"
"),c.find(">.layui-code-h3")[0]||c.prepend('

'+(c.attr("lay-title")||e.title||"code")+(e.about?'layui.code':"")+"

");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss"); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/colorpicker.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var i=layui.jquery,o={config:{},index:layui.colorpicker?layui.colorpicker.index+1e4:0,set:function(e){var o=this;return o.config=i.extend({},o.config,e),o},on:function(e,i){return layui.onevent.call(this,"colorpicker",e,i)}},r=function(){var e=this,i=e.config;return{config:i}},t="colorpicker",n="layui-show",l="layui-colorpicker",c=".layui-colorpicker-main",a="layui-icon-down",s="layui-icon-close",f="layui-colorpicker-trigger-span",d="layui-colorpicker-trigger-i",u="layui-colorpicker-side",p="layui-colorpicker-side-slider",g="layui-colorpicker-basis",v="layui-colorpicker-alpha-bgcolor",h="layui-colorpicker-alpha-slider",m="layui-colorpicker-basis-cursor",b="layui-colorpicker-main-input",k=function(e){var i={h:0,s:0,b:0},o=Math.min(e.r,e.g,e.b),r=Math.max(e.r,e.g,e.b),t=r-o;return i.b=r,i.s=0!=r?255*t/r:0,0!=i.s?e.r==r?i.h=(e.g-e.b)/t:e.g==r?i.h=2+(e.b-e.r)/t:i.h=4+(e.r-e.g)/t:i.h=-1,r==o&&(i.h=0),i.h*=60,i.h<0&&(i.h+=360),i.s*=100/255,i.b*=100/255,i},y=function(e){var e=e.indexOf("#")>-1?e.substring(1):e;if(3==e.length){var i=e.split("");e=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]}e=parseInt(e,16);var o={r:e>>16,g:(65280&e)>>8,b:255&e};return k(o)},x=function(e){var i={},o=e.h,r=255*e.s/100,t=255*e.b/100;if(0==r)i.r=i.g=i.b=t;else{var n=t,l=(255-r)*t/255,c=(n-l)*(o%60)/60;360==o&&(o=0),o<60?(i.r=n,i.b=l,i.g=l+c):o<120?(i.g=n,i.b=l,i.r=n-c):o<180?(i.g=n,i.r=l,i.b=l+c):o<240?(i.b=n,i.r=l,i.g=n-c):o<300?(i.b=n,i.g=l,i.r=l+c):o<360?(i.r=n,i.g=l,i.b=n-c):(i.r=0,i.g=0,i.b=0)}return{r:Math.round(i.r),g:Math.round(i.g),b:Math.round(i.b)}},C=function(e){var o=x(e),r=[o.r.toString(16),o.g.toString(16),o.b.toString(16)];return i.each(r,function(e,i){1==i.length&&(r[e]="0"+i)}),r.join("")},P=function(e){var i=/[0-9]{1,3}/g,o=e.match(i)||[];return{r:o[0],g:o[1],b:o[2]}},B=i(window),w=i(document),D=function(e){var r=this;r.index=++o.index,r.config=i.extend({},r.config,o.config,e),r.render()};D.prototype.config={color:"",size:null,alpha:!1,format:"hex",predefine:!1,colors:["#009688","#5FB878","#1E9FFF","#FF5722","#FFB800","#01AAED","#999","#c00","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","rgb(0, 186, 189)","rgb(255, 120, 0)","rgb(250, 212, 0)","#393D49","rgba(0,0,0,.5)","rgba(255, 69, 0, 0.68)","rgba(144, 240, 144, 0.5)","rgba(31, 147, 255, 0.73)"]},D.prototype.render=function(){var e=this,o=e.config,r=i(['
',"",'3&&(o.alpha&&"rgb"==o.format||(e="#"+C(k(P(o.color))))),"background: "+e):e}()+'">','',"","","
"].join("")),t=i(o.elem);o.size&&r.addClass("layui-colorpicker-"+o.size),t.addClass("layui-inline").html(e.elemColorBox=r),e.color=e.elemColorBox.find("."+f)[0].style.background,e.events()},D.prototype.renderPicker=function(){var e=this,o=e.config,r=e.elemColorBox[0],t=e.elemPicker=i(['
','
','
','
','
','
',"
",'
','
',"
","
",'
','
','
',"
","
",function(){if(o.predefine){var e=['
'];return layui.each(o.colors,function(i,o){e.push(['
','
',"
"].join(""))}),e.push("
"),e.join("")}return""}(),'
','
','',"
",'
','','',"","
"].join(""));e.elemColorBox.find("."+f)[0];i(c)[0]&&i(c).data("index")==e.index?e.removePicker(D.thisElemInd):(e.removePicker(D.thisElemInd),i("body").append(t)),D.thisElemInd=e.index,D.thisColor=r.style.background,e.position(),e.pickerEvents()},D.prototype.removePicker=function(e){var o=this;o.config;return i("#layui-colorpicker"+(e||o.index)).remove(),o},D.prototype.position=function(){var e=this,i=e.config,o=e.bindElem||e.elemColorBox[0],r=e.elemPicker[0],t=o.getBoundingClientRect(),n=r.offsetWidth,l=r.offsetHeight,c=function(e){return e=e?"scrollLeft":"scrollTop",document.body[e]|document.documentElement[e]},a=function(e){return document.documentElement[e?"clientWidth":"clientHeight"]},s=5,f=t.left,d=t.bottom;f-=(n-o.offsetWidth)/2,d+=s,f+n+s>a("width")?f=a("width")-n-s:fa()&&(d=t.top>l?t.top-l:a()-l,d-=2*s),i.position&&(r.style.position=i.position),r.style.left=f+("fixed"===i.position?0:c(1))+"px",r.style.top=d+("fixed"===i.position?0:c())+"px"},D.prototype.val=function(){var e=this,i=(e.config,e.elemColorBox.find("."+f)),o=e.elemPicker.find("."+b),r=i[0],t=r.style.backgroundColor;if(t){var n=k(P(t)),l=i.attr("lay-type");if(e.select(n.h,n.s,n.b),"torgb"===l&&o.find("input").val(t),"rgba"===l){var c=P(t);if(3==(t.match(/[0-9]{1,3}/g)||[]).length)o.find("input").val("rgba("+c.r+", "+c.g+", "+c.b+", 1)"),e.elemPicker.find("."+h).css("left",280);else{o.find("input").val(t);var a=280*t.slice(t.lastIndexOf(",")+1,t.length-1);e.elemPicker.find("."+h).css("left",a)}e.elemPicker.find("."+v)[0].style.background="linear-gradient(to right, rgba("+c.r+", "+c.g+", "+c.b+", 0), rgb("+c.r+", "+c.g+", "+c.b+"))"}}else e.select(0,100,100),o.find("input").val(""),e.elemPicker.find("."+v)[0].style.background="",e.elemPicker.find("."+h).css("left",280)},D.prototype.side=function(){var e=this,o=e.config,r=e.elemColorBox.find("."+f),t=r.attr("lay-type"),n=e.elemPicker.find("."+u),l=e.elemPicker.find("."+p),c=e.elemPicker.find("."+g),y=e.elemPicker.find("."+m),C=e.elemPicker.find("."+v),w=e.elemPicker.find("."+h),D=l[0].offsetTop/180*360,E=100-(y[0].offsetTop+3)/180*100,H=(y[0].offsetLeft+3)/260*100,W=Math.round(w[0].offsetLeft/280*100)/100,j=e.elemColorBox.find("."+d),F=e.elemPicker.find(".layui-colorpicker-pre").children("div"),L=function(i,n,l,c){e.select(i,n,l);var f=x({h:i,s:n,b:l});if(j.addClass(a).removeClass(s),r[0].style.background="rgb("+f.r+", "+f.g+", "+f.b+")","torgb"===t&&e.elemPicker.find("."+b).find("input").val("rgb("+f.r+", "+f.g+", "+f.b+")"),"rgba"===t){var d=0;d=280*c,w.css("left",d),e.elemPicker.find("."+b).find("input").val("rgba("+f.r+", "+f.g+", "+f.b+", "+c+")"),r[0].style.background="rgba("+f.r+", "+f.g+", "+f.b+", "+c+")",C[0].style.background="linear-gradient(to right, rgba("+f.r+", "+f.g+", "+f.b+", 0), rgb("+f.r+", "+f.g+", "+f.b+"))"}o.change&&o.change(e.elemPicker.find("."+b).find("input").val())},M=i(['
t&&(r=t);var l=r/180*360;D=l,L(l,H,E,W),e.preventDefault()};Y(r),e.preventDefault()}),n.on("click",function(e){var o=e.clientY-i(this).offset().top;o<0&&(o=0),o>this.offsetHeight&&(o=this.offsetHeight);var r=o/180*360;D=r,L(r,H,E,W),e.preventDefault()}),y.on("mousedown",function(e){var i=this.offsetTop,o=this.offsetLeft,r=e.clientY,t=e.clientX,n=function(e){var n=i+(e.clientY-r),l=o+(e.clientX-t),a=c[0].offsetHeight-3,s=c[0].offsetWidth-3;n<-3&&(n=-3),n>a&&(n=a),l<-3&&(l=-3),l>s&&(l=s);var f=(l+3)/260*100,d=100-(n+3)/180*100;E=d,H=f,L(D,f,d,W),e.preventDefault()};layui.stope(e),Y(n),e.preventDefault()}),c.on("mousedown",function(e){var o=e.clientY-i(this).offset().top-3+B.scrollTop(),r=e.clientX-i(this).offset().left-3+B.scrollLeft();o<-3&&(o=-3),o>this.offsetHeight-3&&(o=this.offsetHeight-3),r<-3&&(r=-3),r>this.offsetWidth-3&&(r=this.offsetWidth-3);var t=(r+3)/260*100,n=100-(o+3)/180*100;E=n,H=t,L(D,t,n,W),e.preventDefault(),y.trigger(e,"mousedown")}),w.on("mousedown",function(e){var i=this.offsetLeft,o=e.clientX,r=function(e){var r=i+(e.clientX-o),t=C[0].offsetWidth;r<0&&(r=0),r>t&&(r=t);var n=Math.round(r/280*100)/100;W=n,L(D,H,E,n),e.preventDefault()};Y(r),e.preventDefault()}),C.on("click",function(e){var o=e.clientX-i(this).offset().left;o<0&&(o=0),o>this.offsetWidth&&(o=this.offsetWidth);var r=Math.round(o/280*100)/100;W=r,L(D,H,E,r),e.preventDefault()}),F.each(function(){i(this).on("click",function(){i(this).parent(".layui-colorpicker-pre").addClass("selected").siblings().removeClass("selected");var e,o=this.style.backgroundColor,r=k(P(o)),t=o.slice(o.lastIndexOf(",")+1,o.length-1);D=r.h,H=r.s,E=r.b,3==(o.match(/[0-9]{1,3}/g)||[]).length&&(t=1),W=t,e=280*t,L(r.h,r.s,r.b,t)})})},D.prototype.select=function(e,i,o,r){var t=this,n=(t.config,C({h:e,s:100,b:100})),l=C({h:e,s:i,b:o}),c=e/360*180,a=180-o/100*180-3,s=i/100*260-3;t.elemPicker.find("."+p).css("top",c),t.elemPicker.find("."+g)[0].style.background="#"+n,t.elemPicker.find("."+m).css({top:a,left:s}),"change"!==r&&t.elemPicker.find("."+b).find("input").val("#"+l)},D.prototype.pickerEvents=function(){var e=this,o=e.config,r=e.elemColorBox.find("."+f),t=e.elemPicker.find("."+b+" input"),n={clear:function(i){r[0].style.background="",e.elemColorBox.find("."+d).removeClass(a).addClass(s),e.color="",o.done&&o.done(""),e.removePicker()},confirm:function(i,n){var l=t.val(),c=l,f={};if(l.indexOf(",")>-1){if(f=k(P(l)),e.select(f.h,f.s,f.b),r[0].style.background=c="#"+C(f),(l.match(/[0-9]{1,3}/g)||[]).length>3&&"rgba"===r.attr("lay-type")){var u=280*l.slice(l.lastIndexOf(",")+1,l.length-1);e.elemPicker.find("."+h).css("left",u),r[0].style.background=l,c=l}}else f=y(l),r[0].style.background=c="#"+C(f),e.elemColorBox.find("."+d).removeClass(s).addClass(a);return"change"===n?(e.select(f.h,f.s,f.b,n),void(o.change&&o.change(c))):(e.color=l,o.done&&o.done(l),void e.removePicker())}};e.elemPicker.on("click","*[colorpicker-events]",function(){var e=i(this),o=e.attr("colorpicker-events");n[o]&&n[o].call(this,e)}),t.on("keyup",function(e){var o=i(this);n.confirm.call(this,o,13===e.keyCode?null:"change")})},D.prototype.events=function(){var e=this,o=e.config,r=e.elemColorBox.find("."+f);e.elemColorBox.on("click",function(){e.renderPicker(),i(c)[0]&&(e.val(),e.side())}),o.elem[0]&&!e.elemColorBox[0].eventHandler&&(w.on("click",function(o){if(!i(o.target).hasClass(l)&&!i(o.target).parents("."+l)[0]&&!i(o.target).hasClass(c.replace(/\./g,""))&&!i(o.target).parents(c)[0]&&e.elemPicker){if(e.color){var t=k(P(e.color));e.select(t.h,t.s,t.b)}else e.elemColorBox.find("."+d).removeClass(a).addClass(s);r[0].style.background=e.color||"",e.removePicker()}}),B.on("resize",function(){return!(!e.elemPicker||!i(c)[0])&&void e.position()}),e.elemColorBox[0].eventHandler=!0)},o.render=function(e){var i=new D(e);return r.call(i)},e(t,o)}); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/element.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(t){"use strict";var a=layui.$,i=(layui.hint(),layui.device()),e="element",l="layui-this",n="layui-show",s=function(){this.config={}};s.prototype.set=function(t){var i=this;return a.extend(!0,i.config,t),i},s.prototype.on=function(t,a){return layui.onevent.call(this,e,t,a)},s.prototype.tabAdd=function(t,i){var e=".layui-tab-title",l=a(".layui-tab[lay-filter="+t+"]"),n=l.children(e),s=n.children(".layui-tab-bar"),o=l.children(".layui-tab-content"),r='
  • "+(i.title||"unnaming")+"
  • ";return s[0]?s.before(r):n.append(r),o.append('
    '+(i.content||"")+"
    "),f.hideTabMore(!0),f.tabAuto(),this},s.prototype.tabDelete=function(t,i){var e=".layui-tab-title",l=a(".layui-tab[lay-filter="+t+"]"),n=l.children(e),s=n.find('>li[lay-id="'+i+'"]');return f.tabDelete(null,s),this},s.prototype.tabChange=function(t,i){var e=".layui-tab-title",l=a(".layui-tab[lay-filter="+t+"]"),n=l.children(e),s=n.find('>li[lay-id="'+i+'"]');return f.tabClick.call(s[0],null,null,s),this},s.prototype.tab=function(t){t=t||{},b.on("click",t.headerElem,function(i){var e=a(this).index();f.tabClick.call(this,i,e,null,t)})},s.prototype.progress=function(t,i){var e="layui-progress",l=a("."+e+"[lay-filter="+t+"]"),n=l.find("."+e+"-bar"),s=n.find("."+e+"-text");return n.css("width",i),s.text(i),this};var o=".layui-nav",r="layui-nav-item",c="layui-nav-bar",u="layui-nav-tree",d="layui-nav-child",y="layui-nav-more",h="layui-anim layui-anim-upbit",f={tabClick:function(t,i,s,o){o=o||{};var r=s||a(this),i=i||r.parent().children("li").index(r),c=o.headerElem?r.parent():r.parents(".layui-tab").eq(0),u=o.bodyElem?a(o.bodyElem):c.children(".layui-tab-content").children(".layui-tab-item"),d=r.find("a"),y=c.attr("lay-filter");"javascript:;"!==d.attr("href")&&"_blank"===d.attr("target")||(r.addClass(l).siblings().removeClass(l),u.eq(i).addClass(n).siblings().removeClass(n)),layui.event.call(this,e,"tab("+y+")",{elem:c,index:i})},tabDelete:function(t,i){var n=i||a(this).parent(),s=n.index(),o=n.parents(".layui-tab").eq(0),r=o.children(".layui-tab-content").children(".layui-tab-item"),c=o.attr("lay-filter");n.hasClass(l)&&(n.next()[0]?f.tabClick.call(n.next()[0],null,s+1):n.prev()[0]&&f.tabClick.call(n.prev()[0],null,s-1)),n.remove(),r.eq(s).remove(),setTimeout(function(){f.tabAuto()},50),layui.event.call(this,e,"tabDelete("+c+")",{elem:o,index:s})},tabAuto:function(){var t="layui-tab-more",e="layui-tab-bar",l="layui-tab-close",n=this;a(".layui-tab").each(function(){var s=a(this),o=s.children(".layui-tab-title"),r=(s.children(".layui-tab-content").children(".layui-tab-item"),'lay-stope="tabmore"'),c=a('');if(n===window&&8!=i.ie&&f.hideTabMore(!0),s.attr("lay-allowClose")&&o.find("li").each(function(){var t=a(this);if(!t.find("."+l)[0]){var i=a('');i.on("click",f.tabDelete),t.append(i)}}),"string"!=typeof s.attr("lay-unauto"))if(o.prop("scrollWidth")>o.outerWidth()+1){if(o.find("."+e)[0])return;o.append(c),s.attr("overflow",""),c.on("click",function(a){o[this.title?"removeClass":"addClass"](t),this.title=this.title?"":"收缩"})}else o.find("."+e).remove(),s.removeAttr("overflow")})},hideTabMore:function(t){var i=a(".layui-tab-title");t!==!0&&"tabmore"===a(t.target).attr("lay-stope")||(i.removeClass("layui-tab-more"),i.find(".layui-tab-bar").attr("title",""))},clickThis:function(){var t=a(this),i=t.parents(o),n=i.attr("lay-filter"),s=t.parent(),c=t.siblings("."+d),y="string"==typeof s.attr("lay-unselect");"javascript:;"!==t.attr("href")&&"_blank"===t.attr("target")||y||c[0]||(i.find("."+l).removeClass(l),s.addClass(l)),i.hasClass(u)&&(c.removeClass(h),c[0]&&(s["none"===c.css("display")?"addClass":"removeClass"](r+"ed"),"all"===i.attr("lay-shrink")&&s.siblings().removeClass(r+"ed"))),layui.event.call(this,e,"nav("+n+")",t)},collapse:function(){var t=a(this),i=t.find(".layui-colla-icon"),l=t.siblings(".layui-colla-content"),s=t.parents(".layui-collapse").eq(0),o=s.attr("lay-filter"),r="none"===l.css("display");if("string"==typeof s.attr("lay-accordion")){var c=s.children(".layui-colla-item").children("."+n);c.siblings(".layui-colla-title").children(".layui-colla-icon").html(""),c.removeClass(n)}l[r?"addClass":"removeClass"](n),i.html(r?"":""),layui.event.call(this,e,"collapse("+o+")",{title:t,content:l,show:r})}};s.prototype.init=function(t,e){var l=function(){return e?'[lay-filter="'+e+'"]':""}(),s={tab:function(){f.tabAuto.call({})},nav:function(){var t=200,e={},s={},p={},b=function(l,o,r){var c=a(this),f=c.find("."+d);o.hasClass(u)?l.css({top:c.position().top,height:c.children("a").outerHeight(),opacity:1}):(f.addClass(h),l.css({left:c.position().left+parseFloat(c.css("marginLeft")),top:c.position().top+c.height()-l.height()}),e[r]=setTimeout(function(){l.css({width:c.width(),opacity:1})},i.ie&&i.ie<10?0:t),clearTimeout(p[r]),"block"===f.css("display")&&clearTimeout(s[r]),s[r]=setTimeout(function(){f.addClass(n),c.find("."+y).addClass(y+"d")},300))};a(o+l).each(function(i){var l=a(this),o=a(''),h=l.find("."+r);l.find("."+c)[0]||(l.append(o),h.on("mouseenter",function(){b.call(this,o,l,i)}).on("mouseleave",function(){l.hasClass(u)||(clearTimeout(s[i]),s[i]=setTimeout(function(){l.find("."+d).removeClass(n),l.find("."+y).removeClass(y+"d")},300))}),l.on("mouseleave",function(){clearTimeout(e[i]),p[i]=setTimeout(function(){l.hasClass(u)?o.css({height:0,top:o.position().top+o.height()/2,opacity:0}):o.css({width:0,left:o.position().left+o.width()/2,opacity:0})},t)})),h.find("a").each(function(){var t=a(this),i=(t.parent(),t.siblings("."+d));i[0]&&!t.children("."+y)[0]&&t.append(''),t.off("click",f.clickThis).on("click",f.clickThis)})})},breadcrumb:function(){var t=".layui-breadcrumb";a(t+l).each(function(){var t=a(this),i="lay-separator",e=t.attr(i)||"/",l=t.find("a");l.next("span["+i+"]")[0]||(l.each(function(t){t!==l.length-1&&a(this).after(""+e+"")}),t.css("visibility","visible"))})},progress:function(){var t="layui-progress";a("."+t+l).each(function(){var i=a(this),e=i.find(".layui-progress-bar"),l=e.attr("lay-percent");e.css("width",function(){return/^.+\/.+$/.test(l)?100*new Function("return "+l)()+"%":l}()),i.attr("lay-showPercent")&&setTimeout(function(){e.html(''+l+"")},350)})},collapse:function(){var t="layui-collapse";a("."+t+l).each(function(){var t=a(this).find(".layui-colla-item");t.each(function(){var t=a(this),i=t.find(".layui-colla-title"),e=t.find(".layui-colla-content"),l="none"===e.css("display");i.find(".layui-colla-icon").remove(),i.append(''+(l?"":"")+""),i.off("click",f.collapse).on("click",f.collapse)})})}};return s[t]?s[t]():layui.each(s,function(t,a){a()})},s.prototype.render=s.prototype.init;var p=new s,b=a(document);p.render();var v=".layui-tab-title li";b.on("click",v,f.tabClick),b.on("click",f.hideTabMore),a(window).on("resize",f.tabAuto),t(e,p)}); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/flow.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="加载更多",h=l('");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),!i&&f.width()&&(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;su)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)}); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/form.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;layui.define("layer",function(e){"use strict";var t=layui.$,i=layui.layer,a=layui.hint(),n=layui.device(),l="form",r=".layui-form",s="layui-this",o="layui-hide",c="layui-disabled",u=function(){this.config={verify:{required:[/[\S]+/,"必填项不能为空"],phone:[/^1\d{10}$/,"请输入正确的手机号"],email:[/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,"邮箱格式不正确"],url:[/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/,"链接格式不正确"],number:function(e){if(!e||isNaN(e))return"只能填写数字"},date:[/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/,"日期格式不正确"],identity:[/(^\d{15}$)|(^\d{17}(x|X|\d)$)/,"请输入正确的身份证号"]}}};u.prototype.set=function(e){var i=this;return t.extend(!0,i.config,e),i},u.prototype.verify=function(e){var i=this;return t.extend(!0,i.config.verify,e),i},u.prototype.on=function(e,t){return layui.onevent.call(this,l,e,t)},u.prototype.val=function(e,i){var a=this,n=t(r+'[lay-filter="'+e+'"]');return n.each(function(e,a){var n=t(this);layui.each(i,function(e,t){var i,a=n.find('[name="'+e+'"]');a[0]&&(i=a[0].type,"checkbox"===i?a[0].checked=t:"radio"===i?a.each(function(){this.value==t&&(this.checked=!0)}):a.val(t))})}),f.render(null,e),a.getValue(e)},u.prototype.getValue=function(e,i){i=i||t(r+'[lay-filter="'+e+'"]').eq(0);var a={},n={},l=i.find("input,select,textarea");return layui.each(l,function(e,t){if(t.name=(t.name||"").replace(/^\s*|\s*&/,""),t.name){if(/^.*\[\]$/.test(t.name)){var i=t.name.match(/^(.*)\[\]$/g)[0];a[i]=0|a[i],t.name=t.name.replace(/^(.*)\[\]$/,"$1["+a[i]++ +"]")}/^checkbox|radio$/.test(t.type)&&!t.checked||(n[t.name]=t.value)}}),n},u.prototype.render=function(e,i){var n=this,u=t(r+function(){return i?'[lay-filter="'+i+'"]':""}()),d={select:function(){var e,i="请选择",a="layui-form-select",n="layui-select-title",r="layui-select-none",d="",f=u.find("select"),v=function(i,l){t(i.target).parent().hasClass(n)&&!l||(t("."+a).removeClass(a+"ed "+a+"up"),e&&d&&e.val(d)),e=null},y=function(i,u,f){var y,p=t(this),m=i.find("."+n),k=m.find("input"),g=i.find("dl"),x=g.children("dd"),b=this.selectedIndex;if(!u){var C=function(){var e=i.offset().top+i.outerHeight()+5-h.scrollTop(),t=g.outerHeight();b=p[0].selectedIndex,i.addClass(a+"ed"),x.removeClass(o),y=null,x.eq(b).addClass(s).siblings().removeClass(s),e+t>h.height()&&e>=t&&i.addClass(a+"up"),T()},w=function(e){i.removeClass(a+"ed "+a+"up"),k.blur(),y=null,e||$(k.val(),function(e){var i=p[0].selectedIndex;e&&(d=t(p[0].options[i]).html(),0===i&&d===k.attr("placeholder")&&(d=""),k.val(d||""))})},T=function(){var e=g.children("dd."+s);if(e[0]){var t=e.position().top,i=g.height(),a=e.height();t>i&&g.scrollTop(t+g.scrollTop()-i+a-5),t<0&&g.scrollTop(t+g.scrollTop()-5)}};m.on("click",function(e){i.hasClass(a+"ed")?w():(v(e,!0),C()),g.find("."+r).remove()}),m.find(".layui-edge").on("click",function(){k.focus()}),k.on("keyup",function(e){var t=e.keyCode;9===t&&C()}).on("keydown",function(e){var t=e.keyCode;9===t&&w();var i=function(t,a){var n,l;e.preventDefault();var r=function(){var e=g.children("dd."+s);if(g.children("dd."+o)[0]&&"next"===t){var i=g.children("dd:not(."+o+",."+c+")"),n=i.eq(0).index();if(n>=0&&n无匹配项

    '):g.find("."+r).remove()},"keyup"),""===t&&g.find("."+r).remove(),void T())};f&&k.on("keyup",q).on("blur",function(i){var a=p[0].selectedIndex;e=k,d=t(p[0].options[a]).html(),0===a&&d===k.attr("placeholder")&&(d=""),setTimeout(function(){$(k.val(),function(e){d||k.val("")},"blur")},200)}),x.on("click",function(){var e=t(this),a=e.attr("lay-value"),n=p.attr("lay-filter");return!e.hasClass(c)&&(e.hasClass("layui-select-tips")?k.val(""):(k.val(e.text()),e.addClass(s)),e.siblings().removeClass(s),p.val(a).removeClass("layui-form-danger"),layui.event.call(this,l,"select("+n+")",{elem:p[0],value:a,othis:i}),w(!0),!1)}),i.find("dl>dt").on("click",function(e){return!1}),t(document).off("click",v).on("click",v)}};f.each(function(e,l){var r=t(this),o=r.next("."+a),u=this.disabled,d=l.value,f=t(l.options[l.selectedIndex]),v=l.options[0];if("string"==typeof r.attr("lay-ignore"))return r.show();var h="string"==typeof r.attr("lay-search"),p=v?v.value?i:v.innerHTML||i:i,m=t(['
    ','
    ','','
    ','
    ',function(e){var t=[];return layui.each(e,function(e,a){0!==e||a.value?"optgroup"===a.tagName.toLowerCase()?t.push("
    "+a.label+"
    "):t.push('
    '+a.innerHTML+"
    "):t.push('
    '+(a.innerHTML||i)+"
    ")}),0===t.length&&t.push('
    没有选项
    '),t.join("")}(r.find("*"))+"
    ","
    "].join(""));o[0]&&o.remove(),r.after(m),y.call(this,m,u,h)})},checkbox:function(){var e={checkbox:["layui-form-checkbox","layui-form-checked","checkbox"],_switch:["layui-form-switch","layui-form-onswitch","switch"]},i=u.find("input[type=checkbox]"),a=function(e,i){var a=t(this);e.on("click",function(){var t=a.attr("lay-filter"),n=(a.attr("lay-text")||"").split("|");a[0].disabled||(a[0].checked?(a[0].checked=!1,e.removeClass(i[1]).find("em").text(n[1])):(a[0].checked=!0,e.addClass(i[1]).find("em").text(n[0])),layui.event.call(a[0],l,i[2]+"("+t+")",{elem:a[0],value:a[0].value,othis:e}))})};i.each(function(i,n){var l=t(this),r=l.attr("lay-skin"),s=(l.attr("lay-text")||"").split("|"),o=this.disabled;"switch"===r&&(r="_"+r);var u=e[r]||e.checkbox;if("string"==typeof l.attr("lay-ignore"))return l.show();var d=l.next("."+u[0]),f=t(['
    ",function(){var e=n.title.replace(/\s/g,""),t={checkbox:[e?""+n.title+"":"",''].join(""),_switch:""+((n.checked?s[0]:s[1])||"")+""};return t[r]||t.checkbox}(),"
    "].join(""));d[0]&&d.remove(),l.after(f),a.call(this,f,u)})},radio:function(){var e="layui-form-radio",i=["",""],a=u.find("input[type=radio]"),n=function(a){var n=t(this),s="layui-anim-scaleSpring";a.on("click",function(){var o=n[0].name,c=n.parents(r),u=n.attr("lay-filter"),d=c.find("input[name="+o.replace(/(\.|#|\[|\])/g,"\\$1")+"]");n[0].disabled||(layui.each(d,function(){var a=t(this).next("."+e);this.checked=!1,a.removeClass(e+"ed"),a.find(".layui-icon").removeClass(s).html(i[1])}),n[0].checked=!0,a.addClass(e+"ed"),a.find(".layui-icon").addClass(s).html(i[0]),layui.event.call(n[0],l,"radio("+u+")",{elem:n[0],value:n[0].value,othis:a}))})};a.each(function(a,l){var r=t(this),s=r.next("."+e),o=this.disabled;if("string"==typeof r.attr("lay-ignore"))return r.show();s[0]&&s.remove();var u=t(['
    ',''+i[l.checked?0:1]+"","
    "+function(){var e=l.title||"";return"string"==typeof r.next().attr("lay-radio")&&(e=r.next().html(),r.next().remove()),e}()+"
    ","
    "].join(""));r.after(u),n.call(this,u)})}};return e?d[e]?d[e]():a.error("不支持的"+e+"表单渲染"):layui.each(d,function(e,t){t()}),n};var d=function(){var e=null,a=f.config.verify,s="layui-form-danger",o={},c=t(this),u=c.parents(r),d=u.find("*[lay-verify]"),v=c.parents("form")[0],h=c.attr("lay-filter");return layui.each(d,function(l,r){var o=t(this),c=o.attr("lay-verify").split("|"),u=o.attr("lay-verType"),d=o.val();if(o.removeClass(s),layui.each(c,function(t,l){var c,f="",v="function"==typeof a[l];if(a[l]){var c=v?f=a[l](d,r):!a[l][0].test(d);if(f=f||a[l][1],"required"===l&&(f=o.attr("lay-reqText")||f),c)return"tips"===u?i.tips(f,function(){return"string"==typeof o.attr("lay-ignore")||"select"!==r.tagName.toLowerCase()&&!/^checkbox|radio$/.test(r.type)?o:o.next()}(),{tips:1}):"alert"===u?i.alert(f,{title:"提示",shadeClose:!0}):i.msg(f,{icon:5,shift:6}),n.android||n.ios||setTimeout(function(){r.focus()},7),o.addClass(s),e=!0}}),e)return e}),!e&&(o=f.getValue(null,u),layui.event.call(this,l,"submit("+h+")",{elem:this,form:v,field:o}))},f=new u,v=t(document),h=t(window);f.render(),v.on("reset",r,function(){var e=t(this).attr("lay-filter");setTimeout(function(){f.render(null,e)},50)}),v.on("submit",r,d).on("click","*[lay-submit]",d),e(l,f)}); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/layedit.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;layui.define(["layer","form"],function(t){"use strict";var e=layui.$,i=layui.layer,a=layui.form,l=(layui.hint(),layui.device()),n="layedit",o="layui-show",r="layui-disabled",c=function(){var t=this;t.index=0,t.config={tool:["strong","italic","underline","del","|","left","center","right","|","link","unlink","face","image"],hideTool:[],height:280}};c.prototype.set=function(t){var i=this;return e.extend(!0,i.config,t),i},c.prototype.on=function(t,e){return layui.onevent(n,t,e)},c.prototype.build=function(t,i){i=i||{};var a=this,n=a.config,r="layui-layedit",c=e("string"==typeof t?"#"+t:t),u="LAY_layedit_"+ ++a.index,d=c.next("."+r),y=e.extend({},n,i),f=function(){var t=[],e={};return layui.each(y.hideTool,function(t,i){e[i]=!0}),layui.each(y.tool,function(i,a){C[a]&&!e[a]&&t.push(C[a])}),t.join("")}(),m=e(['
    ','
    '+f+"
    ",'
    ','',"
    ","
    "].join(""));return l.ie&&l.ie<8?c.removeClass("layui-hide").addClass(o):(d[0]&&d.remove(),s.call(a,m,c[0],y),c.addClass("layui-hide").after(m),a.index)},c.prototype.getContent=function(t){var e=u(t);if(e[0])return d(e[0].document.body.innerHTML)},c.prototype.getText=function(t){var i=u(t);if(i[0])return e(i[0].document.body).text()},c.prototype.setContent=function(t,i,a){var l=u(t);l[0]&&(a?e(l[0].document.body).append(i):e(l[0].document.body).html(i),layedit.sync(t))},c.prototype.sync=function(t){var i=u(t);if(i[0]){var a=e("#"+i[1].attr("textarea"));a.val(d(i[0].document.body.innerHTML))}},c.prototype.getSelection=function(t){var e=u(t);if(e[0]){var i=m(e[0].document);return document.selection?i.text:i.toString()}};var s=function(t,i,a){var l=this,n=t.find("iframe");n.css({height:a.height}).on("load",function(){var o=n.contents(),r=n.prop("contentWindow"),c=o.find("head"),s=e([""].join("")),u=o.find("body");c.append(s),u.attr("contenteditable","true").css({"min-height":a.height}).html(i.value||""),y.apply(l,[r,n,i,a]),g.call(l,r,t,a)})},u=function(t){var i=e("#LAY_layedit_"+t),a=i.prop("contentWindow");return[a,i]},d=function(t){return 8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),t},y=function(t,a,n,o){var r=t.document,c=e(r.body);c.on("keydown",function(t){var e=t.keyCode;if(13===e){var a=m(r),l=p(a),n=l.parentNode;if("pre"===n.tagName.toLowerCase()){if(t.shiftKey)return;return i.msg("请暂时用shift+enter"),!1}r.execCommand("formatBlock",!1,"

    ")}}),e(n).parents("form").on("submit",function(){var t=c.html();8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),n.value=t}),c.on("paste",function(e){r.execCommand("formatBlock",!1,"

    "),setTimeout(function(){f.call(t,c),n.value=c.html()},100)})},f=function(t){var i=this;i.document;t.find("*[style]").each(function(){var t=this.style.textAlign;this.removeAttribute("style"),e(this).css({"text-align":t||""})}),t.find("table").addClass("layui-table"),t.find("script,link").remove()},m=function(t){return t.selection?t.selection.createRange():t.getSelection().getRangeAt(0)},p=function(t){return t.endContainer||t.parentElement().childNodes[0]},v=function(t,i,a){var l=this.document,n=document.createElement(t);for(var o in i)n.setAttribute(o,i[o]);if(n.removeAttribute("text"),l.selection){var r=a.text||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.pasteHTML(e(n).prop("outerHTML")),a.select()}else{var r=a.toString()||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.deleteContents(),a.insertNode(n)}},h=function(t,i){var a=this.document,l="layedit-tool-active",n=p(m(a)),o=function(e){return t.find(".layedit-tool-"+e)};i&&i[i.hasClass(l)?"removeClass":"addClass"](l),t.find(">i").removeClass(l),o("unlink").addClass(r),e(n).parents().each(function(){var t=this.tagName.toLowerCase(),e=this.style.textAlign;"b"!==t&&"strong"!==t||o("b").addClass(l),"i"!==t&&"em"!==t||o("i").addClass(l),"u"===t&&o("u").addClass(l),"strike"===t&&o("d").addClass(l),"p"===t&&("center"===e?o("center").addClass(l):"right"===e?o("right").addClass(l):o("left").addClass(l)),"a"===t&&(o("link").addClass(l),o("unlink").removeClass(r))})},g=function(t,a,l){var n=t.document,o=e(n.body),c={link:function(i){var a=p(i),l=e(a).parent();b.call(o,{href:l.attr("href"),target:l.attr("target")},function(e){var a=l[0];"A"===a.tagName?a.href=e.url:v.call(t,"a",{target:e.target,href:e.url,text:e.url},i)})},unlink:function(t){n.execCommand("unlink")},face:function(e){x.call(this,function(i){v.call(t,"img",{src:i.src,alt:i.alt},e)})},image:function(a){var n=this;layui.use("upload",function(o){var r=l.uploadImage||{};o.render({url:r.url,method:r.type,elem:e(n).find("input")[0],done:function(e){0==e.code?(e.data=e.data||{},v.call(t,"img",{src:e.data.src,alt:e.data.title},a)):i.msg(e.msg||"上传失败")}})})},code:function(e){k.call(o,function(i){v.call(t,"pre",{text:i.code,"lay-lang":i.lang},e)})},help:function(){i.open({type:2,title:"帮助",area:["600px","380px"],shadeClose:!0,shade:.1,skin:"layui-layer-msg",content:["http://www.layui.com/about/layedit/help.html","no"]})}},s=a.find(".layui-layedit-tool"),u=function(){var i=e(this),a=i.attr("layedit-event"),l=i.attr("lay-command");if(!i.hasClass(r)){o.focus();var u=m(n);u.commonAncestorContainer;l?(n.execCommand(l),/justifyLeft|justifyCenter|justifyRight/.test(l)&&n.execCommand("formatBlock",!1,"

    "),setTimeout(function(){o.focus()},10)):c[a]&&c[a].call(this,u),h.call(t,s,i)}},d=/image/;s.find(">i").on("mousedown",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)||u.call(this)}).on("click",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)&&u.call(this)}),o.on("click",function(){h.call(t,s),i.close(x.index)})},b=function(t,e){var l=this,n=i.open({type:1,id:"LAY_layedit_link",area:"350px",shade:.05,shadeClose:!0,moveType:1,title:"超链接",skin:"layui-layer-msg",content:['

      ','
    • ','','
      ','',"
      ","
    • ",'
    • ','','
      ','",'","
      ","
    • ",'
    • ','','',"
    • ","
    "].join(""),success:function(t,n){var o="submit(layedit-link-yes)";a.render("radio"),t.find(".layui-btn-primary").on("click",function(){i.close(n),l.focus()}),a.on(o,function(t){i.close(b.index),e&&e(t.field)})}});b.index=n},x=function(t){var a=function(){var t=["[微笑]","[嘻嘻]","[哈哈]","[可爱]","[可怜]","[挖鼻]","[吃惊]","[害羞]","[挤眼]","[闭嘴]","[鄙视]","[爱你]","[泪]","[偷笑]","[亲亲]","[生病]","[太开心]","[白眼]","[右哼哼]","[左哼哼]","[嘘]","[衰]","[委屈]","[吐]","[哈欠]","[抱抱]","[怒]","[疑问]","[馋嘴]","[拜拜]","[思考]","[汗]","[困]","[睡]","[钱]","[失望]","[酷]","[色]","[哼]","[鼓掌]","[晕]","[悲伤]","[抓狂]","[黑线]","[阴险]","[怒骂]","[互粉]","[心]","[伤心]","[猪头]","[熊猫]","[兔子]","[ok]","[耶]","[good]","[NO]","[赞]","[来]","[弱]","[草泥马]","[神马]","[囧]","[浮云]","[给力]","[围观]","[威武]","[奥特曼]","[礼物]","[钟]","[话筒]","[蜡烛]","[蛋糕]"],e={};return layui.each(t,function(t,i){e[i]=layui.cache.dir+"images/face/"+t+".gif"}),e}();return x.hide=x.hide||function(t){"face"!==e(t.target).attr("layedit-event")&&i.close(x.index)},x.index=i.tips(function(){var t=[];return layui.each(a,function(e,i){t.push('
  • '+e+'
  • ')}),'
      '+t.join("")+"
    "}(),this,{tips:1,time:0,skin:"layui-box layui-util-face",maxWidth:500,success:function(l,n){l.css({marginTop:-4,marginLeft:-10}).find(".layui-clear>li").on("click",function(){t&&t({src:a[this.title],alt:this.title}),i.close(n)}),e(document).off("click",x.hide).on("click",x.hide)}})},k=function(t){var e=this,l=i.open({type:1,id:"LAY_layedit_code",area:"550px",shade:.05,shadeClose:!0,moveType:1,title:"插入代码",skin:"layui-layer-msg",content:['
      ','
    • ','','
      ','","
      ","
    • ",'
    • ','','
      ','',"
      ","
    • ",'
    • ','','',"
    • ","
    "].join(""),success:function(l,n){var o="submit(layedit-code-yes)";a.render("select"),l.find(".layui-btn-primary").on("click",function(){i.close(n),e.focus()}),a.on(o,function(e){i.close(k.index),t&&t(e.field)})}});k.index=l},C={html:'',strong:'',italic:'',underline:'',del:'',"|":'',left:'',center:'',right:'',link:'',unlink:'',face:'',image:'',code:'',help:''},w=new c;t(n,w)}); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/laypage.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?''+a.prev+"":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push(''+(a.first||1)+"");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r2&&e.push('');r<=u;r++)r===a.curr?e.push('"+r+""):e.push(''+r+"");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1…'),0!==t&&e.push(''+(a.last||a.pages)+"")),e.join("")}(),next:function(){return a.next?''+a.next+"":""}(),count:'共 '+a.count+" 条",limit:function(){var e=['"}(),refresh:['','',""].join(""),skip:function(){return['到第','','页',""].join("")}()};return['
    ',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"
    "].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;oi.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)}); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/laytpl.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)}); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/rate.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var a=layui.jquery,i={config:{},index:layui.rate?layui.rate.index+1e4:0,set:function(e){var i=this;return i.config=a.extend({},i.config,e),i},on:function(e,a){return layui.onevent.call(this,n,e,a)}},l=function(){var e=this,a=e.config;return{setvalue:function(a){e.setvalue.call(e,a)},config:a}},n="rate",t="layui-rate",o="layui-icon-rate",s="layui-icon-rate-solid",u="layui-icon-rate-half",r="layui-icon-rate-solid layui-icon-rate-half",c="layui-icon-rate-solid layui-icon-rate",f="layui-icon-rate layui-icon-rate-half",v=function(e){var l=this;l.index=++i.index,l.config=a.extend({},l.config,i.config,e),l.render()};v.prototype.config={length:5,text:!1,readonly:!1,half:!1,value:0,theme:""},v.prototype.render=function(){var e=this,i=e.config,l=i.theme?'style="color: '+i.theme+';"':"";i.elem=a(i.elem),parseInt(i.value)!==i.value&&(i.half||(i.value=Math.ceil(i.value)-i.value<.5?Math.ceil(i.value):Math.floor(i.value)));for(var n='
      ",u=1;u<=i.length;u++){var r='
    • ";i.half&&parseInt(i.value)!==i.value&&u==Math.ceil(i.value)?n=n+'
    • ":n+=r}n+="
    "+(i.text?''+i.value+"星":"")+"";var c=i.elem,f=c.next("."+t);f[0]&&f.remove(),e.elemTemp=a(n),i.span=e.elemTemp.next("span"),i.setText&&i.setText(i.value),c.html(e.elemTemp),c.addClass("layui-inline"),i.readonly||e.action()},v.prototype.setvalue=function(e){var a=this,i=a.config;i.value=e,a.render()},v.prototype.action=function(){var e=this,i=e.config,l=e.elemTemp,n=l.find("i").width();l.children("li").each(function(e){var t=e+1,v=a(this);v.on("click",function(e){if(i.value=t,i.half){var o=e.pageX-a(this).offset().left;o<=n/2&&(i.value=i.value-.5)}i.text&&l.next("span").text(i.value+"星"),i.choose&&i.choose(i.value),i.setText&&i.setText(i.value)}),v.on("mousemove",function(e){if(l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+t+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half){var c=e.pageX-a(this).offset().left;c<=n/2&&v.children("i").addClass(u).removeClass(s)}}),v.on("mouseleave",function(){l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+Math.floor(i.value)+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half&&parseInt(i.value)!==i.value&&l.children("li:eq("+Math.floor(i.value)+")").children("i").addClass(u).removeClass(c)})})},v.prototype.events=function(){var e=this;e.config},i.render=function(e){var a=new v(e);return l.call(a)},e(n,i)}); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/slider.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var i=layui.jquery,t={config:{},index:layui.slider?layui.slider.index+1e4:0,set:function(e){var t=this;return t.config=i.extend({},t.config,e),t},on:function(e,i){return layui.onevent.call(this,n,e,i)}},a=function(){var e=this,i=e.config;return{setValue:function(i,t){return e.slide("set",i,t||0)},config:i}},n="slider",l="layui-disabled",s="layui-slider",r="layui-slider-bar",o="layui-slider-wrap",u="layui-slider-wrap-btn",d="layui-slider-tips",v="layui-slider-input",c="layui-slider-input-txt",m="layui-slider-input-btn",p="layui-slider-hover",f=function(e){var a=this;a.index=++t.index,a.config=i.extend({},a.config,t.config,e),a.render()};f.prototype.config={type:"default",min:0,max:100,value:0,step:1,showstep:!1,tips:!0,input:!1,range:!1,height:200,disabled:!1,theme:"#009688"},f.prototype.render=function(){var e=this,t=e.config;if(t.step<1&&(t.step=1),t.maxt.min?a:t.min,t.value[1]=n>t.min?n:t.min,t.value[0]=t.value[0]>t.max?t.max:t.value[0],t.value[1]=t.value[1]>t.max?t.max:t.value[1];var r=Math.floor((t.value[0]-t.min)/(t.max-t.min)*100),v=Math.floor((t.value[1]-t.min)/(t.max-t.min)*100),m=v-r+"%";r+="%",v+="%"}else{"object"==typeof t.value&&(t.value=Math.min.apply(null,t.value)),t.valuet.max&&(t.value=t.max);var m=Math.floor((t.value-t.min)/(t.max-t.min)*100)+"%"}var p=t.disabled?"#c2c2c2":t.theme,f='
    '+(t.tips?'
    ':"")+'
    '+(t.range?'
    ':"")+"
    ",h=i(t.elem),y=h.next("."+s);if(y[0]&&y.remove(),e.elemTemp=i(f),t.range?(e.elemTemp.find("."+o).eq(0).data("value",t.value[0]),e.elemTemp.find("."+o).eq(1).data("value",t.value[1])):e.elemTemp.find("."+o).data("value",t.value),h.html(e.elemTemp),"vertical"===t.type&&e.elemTemp.height(t.height+"px"),t.showstep){for(var g=(t.max-t.min)/t.step,b="",x=1;x
    ')}e.elemTemp.append(b)}if(t.input&&!t.range){var w=i('
    ');h.css("position","relative"),h.append(w),h.find("."+c).children("input").val(t.value),"vertical"===t.type?w.css({left:0,top:-48}):e.elemTemp.css("margin-right",w.outerWidth()+15)}t.disabled?(e.elemTemp.addClass(l),e.elemTemp.find("."+u).addClass(l)):e.slide(),e.elemTemp.find("."+u).on("mouseover",function(){var a="vertical"===t.type?t.height:e.elemTemp[0].offsetWidth,n=e.elemTemp.find("."+o),l="vertical"===t.type?a-i(this).parent()[0].offsetTop-n.height():i(this).parent()[0].offsetLeft,s=l/a*100,r=i(this).parent().data("value"),u=t.setTips?t.setTips(r):r;e.elemTemp.find("."+d).html(u),"vertical"===t.type?e.elemTemp.find("."+d).css({bottom:s+"%","margin-bottom":"20px",display:"inline-block"}):e.elemTemp.find("."+d).css({left:s+"%",display:"inline-block"})}).on("mouseout",function(){e.elemTemp.find("."+d).css("display","none")})},f.prototype.slide=function(e,t,a){var n=this,l=n.config,s=n.elemTemp,f=function(){return"vertical"===l.type?l.height:s[0].offsetWidth},h=s.find("."+o),y=s.next("."+v),g=y.children("."+c).children("input").val(),b=100/((l.max-l.min)/Math.ceil(l.step)),x=function(e,i){e=Math.ceil(e)*b>100?Math.ceil(e)*b:Math.round(e)*b,e=e>100?100:e,h.eq(i).css("vertical"===l.type?"bottom":"left",e+"%");var t=T(h[0].offsetLeft),a=l.range?T(h[1].offsetLeft):0;"vertical"===l.type?(s.find("."+d).css({bottom:e+"%","margin-bottom":"20px"}),t=T(f()-h[0].offsetTop-h.height()),a=l.range?T(f()-h[1].offsetTop-h.height()):0):s.find("."+d).css("left",e+"%"),t=t>100?100:t,a=a>100?100:a;var n=Math.min(t,a),o=Math.abs(t-a);"vertical"===l.type?s.find("."+r).css({height:o+"%",bottom:n+"%"}):s.find("."+r).css({width:o+"%",left:n+"%"});var u=l.min+Math.round((l.max-l.min)*e/100);if(g=u,y.children("."+c).children("input").val(g),h.eq(i).data("value",u),u=l.setTips?l.setTips(u):u,s.find("."+d).html(u),l.range){var v=[h.eq(0).data("value"),h.eq(1).data("value")];v[0]>v[1]&&v.reverse()}l.change&&l.change(l.range?v:u)},T=function(e){var i=e/f()*100/b,t=Math.round(i)*b;return e==f()&&(t=Math.ceil(i)*b),t},w=i(['
    f()&&(r=f());var o=r/f()*100/b;x(o,e),t.addClass(p),s.find("."+d).show(),i.preventDefault()},o=function(){t.removeClass(p),s.find("."+d).hide()};M(r,o)})}),s.on("click",function(e){var t=i("."+u);if(!t.is(event.target)&&0===t.has(event.target).length&&t.length){var a,n="vertical"===l.type?f()-e.clientY+i(this).offset().top:e.clientX-i(this).offset().left;n<0&&(n=0),n>f()&&(n=f());var s=n/f()*100/b;a=l.range?"vertical"===l.type?Math.abs(n-parseInt(i(h[0]).css("bottom")))>Math.abs(n-parseInt(i(h[1]).css("bottom")))?1:0:Math.abs(n-h[0].offsetLeft)>Math.abs(n-h[1].offsetLeft)?1:0:0,x(s,a),e.preventDefault()}}),y.hover(function(){var e=i(this);e.children("."+m).fadeIn("fast")},function(){var e=i(this);e.children("."+m).fadeOut("fast")}),y.children("."+m).children("i").each(function(e){i(this).on("click",function(){g=1==e?g-l.stepl.max?l.max:Number(g)+l.step;var i=(g-l.min)/(l.max-l.min)*100/b;x(i,0)})});var q=function(){var e=this.value;e=isNaN(e)?0:e,e=el.max?l.max:e,this.value=e;var i=(e-l.min)/(l.max-l.min)*100/b;x(i,0)};y.children("."+c).children("input").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),q.call(this))}).on("change",q)},f.prototype.events=function(){var e=this;e.config},t.render=function(e){var i=new f(e);return a.call(i)},e(n,t)}); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/transfer.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;layui.define(["laytpl","form"],function(e){"use strict";var a=layui.$,t=layui.laytpl,n=layui.form,i="transfer",l={config:{},index:layui[i]?layui[i].index+1e4:0,set:function(e){var t=this;return t.config=a.extend({},t.config,e),t},on:function(e,a){return layui.onevent.call(this,i,e,a)}},r=function(){var e=this,a=e.config,t=a.id||e.index;return r.that[t]=e,r.config[t]=a,{config:a,reload:function(a){e.reload.call(e,a)},getData:function(){return e.getData.call(e)}}},c="layui-hide",o="layui-btn-disabled",d="layui-none",s="layui-transfer-box",u="layui-transfer-header",h="layui-transfer-search",f="layui-transfer-active",y="layui-transfer-data",p=function(e){return e=e||{},['
    ','
    ','","
    ","{{# if(d.data.showSearch){ }}",'","{{# } }}",'
      ',"
      "].join("")},v=['
      ',p({index:0,checkAllName:"layTransferLeftCheckAll"}),'
      ','",'","
      ",p({index:1,checkAllName:"layTransferRightCheckAll"}),"
      "].join(""),x=function(e){var t=this;t.index=++l.index,t.config=a.extend({},t.config,l.config,e),t.render()};x.prototype.config={title:["列表一","列表二"],width:200,height:360,data:[],value:[],showSearch:!1,id:"",text:{none:"无数据",searchNone:"无匹配数据"}},x.prototype.reload=function(e){var t=this;layui.each(e,function(e,a){a.constructor===Array&&delete t.config[e]}),t.config=a.extend(!0,{},t.config,e),t.render()},x.prototype.render=function(){var e=this,n=e.config,i=e.elem=a(t(v).render({data:n,index:e.index})),l=n.elem=a(n.elem);l[0]&&(n.data=n.data||[],n.value=n.value||[],e.key=n.id||e.index,l.html(e.elem),e.layBox=e.elem.find("."+s),e.layHeader=e.elem.find("."+u),e.laySearch=e.elem.find("."+h),e.layData=i.find("."+y),e.layBtn=i.find("."+f+" .layui-btn"),e.layBox.css({width:n.width,height:n.height}),e.layData.css({height:function(){return n.height-e.layHeader.outerHeight()-e.laySearch.outerHeight()-2}()}),e.renderData(),e.events())},x.prototype.renderData=function(){var e=this,a=(e.config,[{checkName:"layTransferLeftCheck",views:[]},{checkName:"layTransferRightCheck",views:[]}]);e.parseData(function(e){var t=e.selected?1:0,n=["
    • ",'',"
    • "].join("");a[t].views.push(n),delete e.selected}),e.layData.eq(0).html(a[0].views.join("")),e.layData.eq(1).html(a[1].views.join("")),e.renderCheckBtn()},x.prototype.renderForm=function(e){n.render(e,"LAY-transfer-"+this.index)},x.prototype.renderCheckBtn=function(e){var t=this,n=t.config;e=e||{},t.layBox.each(function(i){var l=a(this),r=l.find("."+y),d=l.find("."+u).find('input[type="checkbox"]'),s=r.find('input[type="checkbox"]'),h=0,f=!1;if(s.each(function(){var e=a(this).data("hide");(this.checked||this.disabled||e)&&h++,this.checked&&!e&&(f=!0)}),d.prop("checked",f&&h===s.length),t.layBtn.eq(i)[f?"removeClass":"addClass"](o),!e.stopNone){var p=r.children("li:not(."+c+")").length;t.noneView(r,p?"":n.text.none)}}),t.renderForm("checkbox")},x.prototype.noneView=function(e,t){var n=a('

      '+(t||"")+"

      ");e.find("."+d)[0]&&e.find("."+d).remove(),t.replace(/\s/g,"")&&e.append(n)},x.prototype.setValue=function(){var e=this,t=e.config,n=[];return e.layBox.eq(1).find("."+y+' input[type="checkbox"]').each(function(){var e=a(this).data("hide");e||n.push(this.value)}),t.value=n,e},x.prototype.parseData=function(e){var t=this,n=t.config,i=[];return layui.each(n.data,function(t,l){l=("function"==typeof n.parseData?n.parseData(l):l)||l,i.push(l=a.extend({},l)),layui.each(n.value,function(e,a){a==l.value&&(l.selected=!0)}),e&&e(l)}),n.data=i,t},x.prototype.getData=function(e){var a=this,t=a.config,n=[];return a.setValue(),layui.each(e||t.value,function(e,a){layui.each(t.data,function(e,t){delete t.selected,a==t.value&&n.push(t)})}),n},x.prototype.events=function(){var e=this,t=e.config;e.elem.on("click",'input[lay-filter="layTransferCheckbox"]+',function(){var t=a(this).prev(),n=t[0].checked,i=t.parents("."+s).eq(0).find("."+y);t[0].disabled||("all"===t.attr("lay-type")&&i.find('input[type="checkbox"]').each(function(){this.disabled||(this.checked=n)}),e.renderCheckBtn({stopNone:!0}))}),e.layBtn.on("click",function(){var n=a(this),i=n.data("index"),l=e.layBox.eq(i),r=[];if(!n.hasClass(o)){e.layBox.eq(i).each(function(t){var n=a(this),i=n.find("."+y);i.children("li").each(function(){var t=a(this),n=t.find('input[type="checkbox"]'),i=n.data("hide");n[0].checked&&!i&&(n[0].checked=!1,l.siblings("."+s).find("."+y).append(t.clone()),t.remove(),r.push(n[0].value)),e.setValue()})}),e.renderCheckBtn();var c=l.siblings("."+s).find("."+h+" input");""===c.val()||c.trigger("keyup"),t.onchange&&t.onchange(e.getData(r),i)}}),e.laySearch.find("input").on("keyup",function(){var n=this.value,i=a(this).parents("."+h).eq(0).siblings("."+y),l=i.children("li");l.each(function(){var e=a(this),t=e.find('input[type="checkbox"]'),i=t[0].title.indexOf(n)!==-1;e[i?"removeClass":"addClass"](c),t.data("hide",!i)}),e.renderCheckBtn();var r=l.length===i.children("li."+c).length;e.noneView(i,r?t.text.searchNone:"")})},r.that={},r.config={},l.reload=function(e,a){var t=r.that[e];return t.reload(a),r.call(t)},l.getData=function(e){var a=r.that[e];return a.getData()},l.render=function(e){var a=new x(e);return r.call(a)},e(i,l)}); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/tree.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;layui.define("form",function(e){"use strict";var i=layui.$,a=layui.form,n=layui.layer,t="tree",r={config:{},index:layui[t]?layui[t].index+1e4:0,set:function(e){var a=this;return a.config=i.extend({},a.config,e),a},on:function(e,i){return layui.onevent.call(this,t,e,i)}},l=function(){var e=this,i=e.config,a=i.id||e.index;return l.that[a]=e,l.config[a]=i,{config:i,reload:function(i){e.reload.call(e,i)},getChecked:function(){return e.getChecked.call(e)},setChecked:function(i){return e.setChecked.call(e,i)}}},c="layui-hide",d="layui-disabled",s="layui-tree-set",o="layui-tree-iconClick",h="layui-icon-addition",u="layui-icon-subtraction",p="layui-tree-entry",f="layui-tree-main",y="layui-tree-txt",v="layui-tree-pack",C="layui-tree-spread",k="layui-tree-setLineShort",m="layui-tree-showLine",x="layui-tree-lineExtend",b=function(e){var a=this;a.index=++r.index,a.config=i.extend({},a.config,r.config,e),a.render()};b.prototype.config={data:[],showCheckbox:!1,showLine:!0,accordion:!1,onlyIconControl:!1,isJump:!1,edit:!1,text:{defaultNodeName:"未命名",none:"无数据"}},b.prototype.reload=function(e){var a=this;layui.each(e,function(e,i){i.constructor===Array&&delete a.config[e]}),a.config=i.extend(!0,{},a.config,e),a.render()},b.prototype.render=function(){var e=this,a=e.config;e.checkids=[];var n=i('
      ');e.tree(n);var t=a.elem=i(a.elem);if(t[0]){if(e.key=a.id||e.index,e.elem=n,e.elemNone=i('
      '+a.text.none+"
      "),t.html(e.elem),0==e.elem.find(".layui-tree-set").length)return e.elem.append(e.elemNone);a.showCheckbox&&e.renderForm("checkbox"),e.elem.find(".layui-tree-set").each(function(){var e=i(this);e.parent(".layui-tree-pack")[0]||e.addClass("layui-tree-setHide"),!e.next()[0]&&e.parents(".layui-tree-pack").eq(1).hasClass("layui-tree-lineExtend")&&e.addClass(k),e.next()[0]||e.parents(".layui-tree-set").eq(0).next()[0]||e.addClass(k)}),e.events()}},b.prototype.renderForm=function(e){a.render(e,"LAY-tree-"+this.index)},b.prototype.tree=function(e,a){var n=this,t=n.config,r=a||t.data;layui.each(r,function(a,r){var l=r.children&&r.children.length>0,o=i('
      '),h=i(['
      ','
      ','
      ',function(){return t.showLine?l?'':'':''}(),function(){return t.showCheckbox?'':""}(),function(){return t.isJump&&r.href?''+(r.title||r.label||t.text.defaultNodeName)+"":''+(r.title||r.label||t.text.defaultNodeName)+""}(),"
      ",function(){if(!t.edit)return"";var e={add:'',update:'',del:''},i=['
      '];return t.edit===!0&&(t.edit=["update","del"]),"object"==typeof t.edit?(layui.each(t.edit,function(a,n){i.push(e[n]||"")}),i.join("")+"
      "):void 0}(),"
      "].join(""));l&&(h.append(o),n.tree(o,r.children)),e.append(h),h.prev("."+s)[0]&&h.prev().children(".layui-tree-pack").addClass("layui-tree-showLine"),l||h.parent(".layui-tree-pack").addClass("layui-tree-lineExtend"),n.spread(h,r),t.showCheckbox&&(r.checked&&n.checkids.push(r.id),n.checkClick(h,r)),t.edit&&n.operate(h,r)})},b.prototype.spread=function(e,a){var n=this,t=n.config,r=e.children("."+p),l=r.children("."+f),c=r.find("."+o),k=r.find("."+y),m=t.onlyIconControl?c:l,x="";m.on("click",function(i){var a=e.children("."+v),n=m.children(".layui-icon")[0]?m.children(".layui-icon"):m.find(".layui-tree-icon").children(".layui-icon");if(a[0]){if(e.hasClass(C))e.removeClass(C),a.slideUp(200),n.removeClass(u).addClass(h);else if(e.addClass(C),a.slideDown(200),n.addClass(u).removeClass(h),t.accordion){var r=e.siblings("."+s);r.removeClass(C),r.children("."+v).slideUp(200),r.find(".layui-tree-icon").children(".layui-icon").removeClass(u).addClass(h)}}else x="normal"}),k.on("click",function(){var n=i(this);n.hasClass(d)||(x=e.hasClass(C)?t.onlyIconControl?"open":"close":t.onlyIconControl?"close":"open",t.click&&t.click({elem:e,state:x,data:a}))})},b.prototype.setCheckbox=function(e,i,a){var n=this,t=(n.config,a.prop("checked"));if(!a.prop("disabled")){if("object"==typeof i.children||e.find("."+v)[0]){var r=e.find("."+v).find('input[same="layuiTreeCheck"]');r.each(function(){this.disabled||(this.checked=t)})}var l=function(e){if(e.parents("."+s)[0]){var i,a=e.parent("."+v),n=a.parent(),r=a.prev().find('input[same="layuiTreeCheck"]');t?r.prop("checked",t):(a.find('input[same="layuiTreeCheck"]').each(function(){this.checked&&(i=!0)}),i||r.prop("checked",!1)),l(n)}};l(e),n.renderForm("checkbox")}},b.prototype.checkClick=function(e,a){var n=this,t=n.config,r=e.children("."+p),l=r.children("."+f);l.on("click",'input[same="layuiTreeCheck"]+',function(r){layui.stope(r);var l=i(this).prev(),c=l.prop("checked");l.prop("disabled")||(n.setCheckbox(e,a,l),t.oncheck&&t.oncheck({elem:e,checked:c,data:a}))})},b.prototype.operate=function(e,a){var t=this,r=t.config,l=e.children("."+p),d=l.children("."+f);l.children(".layui-tree-btnGroup").on("click",".layui-icon",function(l){layui.stope(l);var f=i(this).data("type"),b=e.children("."+v),g={data:a,type:f,elem:e};if("add"==f){b[0]||(r.showLine?(d.find("."+o).addClass("layui-tree-icon"),d.find("."+o).children(".layui-icon").addClass(h).removeClass("layui-icon-file")):d.find(".layui-tree-iconArrow").removeClass(c),e.append('
      '));var w=r.operate&&r.operate(g),N={};if(N.title=r.text.defaultNodeName,N.id=w,t.tree(e.children("."+v),[N]),r.showLine)if(b[0])b.hasClass(x)||b.addClass(x),e.find("."+v).each(function(){i(this).children("."+s).last().addClass(k)}),b.children("."+s).last().prev().hasClass(k)?b.children("."+s).last().prev().removeClass(k):b.children("."+s).last().removeClass(k),!e.parent("."+v)[0]&&e.next()[0]&&b.children("."+s).last().removeClass(k);else{var T=e.siblings("."+s),L=1,A=e.parent("."+v);layui.each(T,function(e,a){i(a).children("."+v)[0]||(L=0)}),1==L?(T.children("."+v).addClass(m),T.children("."+v).children("."+s).removeClass(k),e.children("."+v).addClass(m),A.removeClass(x),A.children("."+s).last().children("."+v).children("."+s).last().addClass(k)):e.children("."+v).children("."+s).addClass(k)}if(!r.showCheckbox)return;if(d.find('input[same="layuiTreeCheck"]')[0].checked){var I=e.children("."+v).children("."+s).last();I.find('input[same="layuiTreeCheck"]')[0].checked=!0}t.renderForm("checkbox")}else if("update"==f){var F=d.children("."+y).html();d.children("."+y).html(""),d.append(''),d.children(".layui-tree-editInput").val(F).focus();var j=function(e){var i=e.val().trim();i=i?i:r.text.defaultNodeName,e.remove(),d.children("."+y).html(i),g.data.title=i,r.operate&&r.operate(g)};d.children(".layui-tree-editInput").blur(function(){j(i(this))}),d.children(".layui-tree-editInput").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),j(i(this)))})}else n.confirm('确认删除该节点 "'+(a.title||"")+'" 吗?',function(a){if(r.operate&&r.operate(g),g.status="remove",n.close(a),!e.prev("."+s)[0]&&!e.next("."+s)[0]&&!e.parent("."+v)[0])return e.remove(),void t.elem.append(t.elemNone);if(e.siblings("."+s).children("."+p)[0]){if(r.showCheckbox){var l=function(e){if(e.parents("."+s)[0]){var a=e.siblings("."+s).children("."+p),n=e.parent("."+v).prev(),r=n.find('input[same="layuiTreeCheck"]')[0],c=1,d=0;0==r.checked&&(a.each(function(e,a){var n=i(a).find('input[same="layuiTreeCheck"]')[0];0!=n.checked||n.disabled||(c=0),n.disabled||(d=1)}),1==c&&1==d&&(r.checked=!0,t.renderForm("checkbox"),l(n.parent("."+s))))}};l(e)}if(r.showLine){var d=e.siblings("."+s),h=1,f=e.parent("."+v);layui.each(d,function(e,a){i(a).children("."+v)[0]||(h=0)}),1==h?(b[0]||(f.removeClass(x),d.children("."+v).addClass(m),d.children("."+v).children("."+s).removeClass(k)),e.next()[0]?f.children("."+s).last().children("."+v).children("."+s).last().addClass(k):e.prev().children("."+v).children("."+s).last().addClass(k),e.next()[0]||e.parents("."+s)[1]||e.parents("."+s).eq(0).next()[0]||e.prev("."+s).addClass(k)):!e.next()[0]&&e.hasClass(k)&&e.prev().addClass(k)}}else{var y=e.parent("."+v).prev();if(r.showLine){y.find("."+o).removeClass("layui-tree-icon"),y.find("."+o).children(".layui-icon").removeClass(u).addClass("layui-icon-file");var w=y.parents("."+v).eq(0);w.addClass(x),w.children("."+s).each(function(){i(this).children("."+v).children("."+s).last().addClass(k)})}else y.find(".layui-tree-iconArrow").addClass(c);e.parents("."+s).eq(0).removeClass(C),e.parent("."+v).remove()}e.remove()})})},b.prototype.events=function(){var e=this,a=e.config;e.elem.find(".layui-tree-checkedFirst");e.setChecked(e.checkids),e.elem.find(".layui-tree-search").on("keyup",function(){var n=i(this),t=n.val(),r=n.nextAll(),l=[];r.find("."+y).each(function(){var e=i(this).parents("."+p);if(i(this).html().indexOf(t)!=-1){l.push(i(this).parent());var a=function(e){e.addClass("layui-tree-searchShow"),e.parent("."+v)[0]&&a(e.parent("."+v).parent("."+s))};a(e.parent("."+s))}}),r.find("."+p).each(function(){var e=i(this).parent("."+s);e.hasClass("layui-tree-searchShow")||e.addClass(c)}),0==r.find(".layui-tree-searchShow").length&&e.elem.append(e.elemNone),a.onsearch&&a.onsearch({elem:l})}),e.elem.find(".layui-tree-search").on("keydown",function(){i(this).nextAll().find("."+p).each(function(){var e=i(this).parent("."+s);e.removeClass("layui-tree-searchShow "+c)}),i(".layui-tree-emptyText")[0]&&i(".layui-tree-emptyText").remove()})},b.prototype.getChecked=function(){var e=this,a=e.config,n=[],t=[];e.elem.find(".layui-form-checked").each(function(){n.push(i(this).prev()[0].value)});var r=function(e,a){layui.each(e,function(e,t){layui.each(n,function(e,n){if(t.id==n){var l=i.extend({},t);return delete l.children,a.push(l),t.children&&(l.children=[],r(t.children,l.children)),!0}})})};return r(i.extend({},a.data),t),t},b.prototype.setChecked=function(e){var a=this;a.config;a.elem.find("."+s).each(function(a,n){var t=i(this).data("id"),r=i(n).children("."+p).find('input[same="layuiTreeCheck"]'),l=r.next();if("number"==typeof e){if(t==e)return r[0].checked||l.click(),!1}else"object"==typeof e&&layui.each(e,function(e,i){if(i==t&&!r[0].checked)return l.click(),!0})})},l.that={},l.config={},r.reload=function(e,i){var a=l.that[e];return a.reload(i),l.call(a)},r.getChecked=function(e){var i=l.that[e];return i.getChecked()},r.setChecked=function(e,i){var a=l.that[e];return a.setChecked(i)},r.render=function(e){var i=new b(e);return l.call(i)},e(t,r)}); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/upload.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;layui.define("layer",function(e){"use strict";var t=layui.$,i=layui.layer,n=layui.hint(),o=layui.device(),a={config:{},set:function(e){var i=this;return i.config=t.extend({},i.config,e),i},on:function(e,t){return layui.onevent.call(this,r,e,t)}},l=function(){var e=this;return{upload:function(t){e.upload.call(e,t)},reload:function(t){e.reload.call(e,t)},config:e.config}},r="upload",u="layui-upload-file",c="layui-upload-form",f="layui-upload-iframe",s="layui-upload-choose",p=function(e){var i=this;i.config=t.extend({},i.config,a.config,e),i.render()};p.prototype.config={accept:"images",exts:"",auto:!0,bindAction:"",url:"",field:"file",acceptMime:"",method:"post",data:{},drag:!0,size:0,number:0,multiple:!1},p.prototype.render=function(e){var i=this,e=i.config;e.elem=t(e.elem),e.bindAction=t(e.bindAction),i.file(),i.events()},p.prototype.file=function(){var e=this,i=e.config,n=e.elemFile=t(['"].join("")),a=i.elem.next();(a.hasClass(u)||a.hasClass(c))&&a.remove(),o.ie&&o.ie<10&&i.elem.wrap('
      '),e.isFile()?(e.elemFile=i.elem,i.field=i.elem[0].name):i.elem.after(n),o.ie&&o.ie<10&&e.initIE()},p.prototype.initIE=function(){var e=this,i=e.config,n=t(''),o=t(['
      ',"
      "].join(""));t("#"+f)[0]||t("body").append(n),i.elem.next().hasClass(c)||(e.elemFile.wrap(o),i.elem.next("."+c).append(function(){var e=[];return layui.each(i.data,function(t,i){i="function"==typeof i?i():i,e.push('')}),e.join("")}()))},p.prototype.msg=function(e){return i.msg(e,{icon:2,shift:6})},p.prototype.isFile=function(){var e=this.config.elem[0];if(e)return"input"===e.tagName.toLocaleLowerCase()&&"file"===e.type},p.prototype.preview=function(e){var t=this;window.FileReader&&layui.each(t.chooseFiles,function(t,i){var n=new FileReader;n.readAsDataURL(i),n.onload=function(){e&&e(t,i,this.result)}})},p.prototype.upload=function(e,i){var n,a=this,l=a.config,r=a.elemFile[0],u=function(){var i=0,n=0,o=e||a.files||a.chooseFiles||r.files,u=function(){l.multiple&&i+n===a.fileLength&&"function"==typeof l.allDone&&l.allDone({total:a.fileLength,successful:i,aborted:n})};layui.each(o,function(e,o){var r=new FormData;r.append(l.field,o),layui.each(l.data,function(e,t){t="function"==typeof t?t():t,r.append(e,t)});var c={url:l.url,type:"post",data:r,contentType:!1,processData:!1,dataType:"json",headers:l.headers||{},success:function(t){i++,d(e,t),u()},error:function(){n++,a.msg("请求上传接口出现异常"),m(e),u()}};"function"==typeof l.progress&&(c.xhr=function(){var e=t.ajaxSettings.xhr();return e.upload.addEventListener("progress",function(e){if(e.lengthComputable){var t=Math.floor(e.loaded/e.total*100);l.progress(t,l.item[0],e)}}),e}),t.ajax(c)})},c=function(){var e=t("#"+f);a.elemFile.parent().submit(),clearInterval(p.timer),p.timer=setInterval(function(){var t,i=e.contents().find("body");try{t=i.text()}catch(n){a.msg("获取上传后的响应信息出现异常"),clearInterval(p.timer),m()}t&&(clearInterval(p.timer),i.html(""),d(0,t))},30)},d=function(e,t){if(a.elemFile.next("."+s).remove(),r.value="","object"!=typeof t)try{t=JSON.parse(t)}catch(i){return t={},a.msg("请对上传接口返回有效JSON")}"function"==typeof l.done&&l.done(t,e||0,function(e){a.upload(e)})},m=function(e){l.auto&&(r.value=""),"function"==typeof l.error&&l.error(e||0,function(e){a.upload(e)})},h=l.exts,v=function(){var t=[];return layui.each(e||a.chooseFiles,function(e,i){t.push(i.name)}),t}(),g={preview:function(e){a.preview(e)},upload:function(e,t){var i={};i[e]=t,a.upload(i)},pushFile:function(){return a.files=a.files||{},layui.each(a.chooseFiles,function(e,t){a.files[e]=t}),a.files},resetFile:function(e,t,i){var n=new File([t],i);a.files=a.files||{},a.files[e]=n}},y=function(){if("choose"!==i&&!l.auto||(l.choose&&l.choose(g),"choose"!==i))return l.before&&l.before(g),o.ie?o.ie>9?u():c():void u()};if(v=0===v.length?r.value.match(/[^\/\\]+\..+/g)||[]||"":v,0!==v.length){switch(l.accept){case"file":if(h&&!RegExp("\\w\\.("+h+")$","i").test(escape(v)))return a.msg("选择的文件中包含不支持的格式"),r.value="";break;case"video":if(!RegExp("\\w\\.("+(h||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(v)))return a.msg("选择的视频中包含不支持的格式"),r.value="";break;case"audio":if(!RegExp("\\w\\.("+(h||"mp3|wav|mid")+")$","i").test(escape(v)))return a.msg("选择的音频中包含不支持的格式"),r.value="";break;default:if(layui.each(v,function(e,t){RegExp("\\w\\.("+(h||"jpg|png|gif|bmp|jpeg$")+")","i").test(escape(t))||(n=!0)}),n)return a.msg("选择的图片中包含不支持的格式"),r.value=""}if(a.fileLength=function(){var t=0,i=e||a.files||a.chooseFiles||r.files;return layui.each(i,function(){t++}),t}(),l.number&&a.fileLength>l.number)return a.msg("同时最多只能上传的数量为:"+l.number);if(l.size>0&&!(o.ie&&o.ie<10)){var F;if(layui.each(a.chooseFiles,function(e,t){if(t.size>1024*l.size){var i=l.size/1024;i=i>=1?i.toFixed(2)+"MB":l.size+"KB",r.value="",F=i}}),F)return a.msg("文件不能超过"+F)}y()}},p.prototype.reload=function(e){e=e||{},delete e.elem,delete e.bindAction;var i=this,e=i.config=t.extend({},i.config,a.config,e),n=e.elem.next();n.attr({name:e.name,accept:e.acceptMime,multiple:e.multiple})},p.prototype.events=function(){var e=this,i=e.config,a=function(t){e.chooseFiles={},layui.each(t,function(t,i){var n=(new Date).getTime();e.chooseFiles[n+"-"+t]=i})},l=function(t,n){var o=e.elemFile,a=t.length>1?t.length+"个文件":(t[0]||{}).name||o[0].value.match(/[^\/\\]+\..+/g)||[]||"";o.next().hasClass(s)&&o.next().remove(),e.upload(null,"choose"),e.isFile()||i.choose||o.after(''+a+"")};i.elem.off("upload.start").on("upload.start",function(){var o=t(this),a=o.attr("lay-data");if(a)try{a=new Function("return "+a)(),e.config=t.extend({},i,a)}catch(l){n.error("Upload element property lay-data configuration item has a syntax error: "+a)}e.config.item=o,e.elemFile[0].click()}),o.ie&&o.ie<10||i.elem.off("upload.over").on("upload.over",function(){var e=t(this);e.attr("lay-over","")}).off("upload.leave").on("upload.leave",function(){var e=t(this);e.removeAttr("lay-over")}).off("upload.drop").on("upload.drop",function(n,o){var r=t(this),u=o.originalEvent.dataTransfer.files||[];r.removeAttr("lay-over"),a(u),i.auto?e.upload(u):l(u)}),e.elemFile.off("upload.change").on("upload.change",function(){var t=this.files||[];a(t),i.auto?e.upload():l(t)}),i.bindAction.off("upload.action").on("upload.action",function(){e.upload()}),i.elem.data("haveEvents")||(e.elemFile.on("change",function(){t(this).trigger("upload.change")}),i.elem.on("click",function(){e.isFile()||t(this).trigger("upload.start")}),i.drag&&i.elem.on("dragover",function(e){e.preventDefault(),t(this).trigger("upload.over")}).on("dragleave",function(e){t(this).trigger("upload.leave")}).on("drop",function(e){e.preventDefault(),t(this).trigger("upload.drop",e)}),i.bindAction.on("click",function(){t(this).trigger("upload.action")}),i.elem.data("haveEvents",!0))},a.render=function(e){var t=new p(e);return l.call(t)},e(r,a)}); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/util.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var t=layui.$,i={fixbar:function(e){var i,n,a="layui-fixbar",o="layui-fixbar-top",r=t(document),l=t("body");e=t.extend({showHeight:200},e),e.bar1=e.bar1===!0?"":e.bar1,e.bar2=e.bar2===!0?"":e.bar2,e.bgcolor=e.bgcolor?"background-color:"+e.bgcolor:"";var c=[e.bar1,e.bar2,""],u=t(['
        ',e.bar1?'
      • '+c[0]+"
      • ":"",e.bar2?'
      • '+c[1]+"
      • ":"",'
      • '+c[2]+"
      • ","
      "].join("")),g=u.find("."+o),s=function(){var t=r.scrollTop();t>=e.showHeight?i||(g.show(),i=1):i&&(g.hide(),i=0)};t("."+a)[0]||("object"==typeof e.css&&u.css(e.css),l.append(u),s(),u.find("li").on("click",function(){var i=t(this),n=i.attr("lay-type");"top"===n&&t("html,body").animate({scrollTop:0},200),e.click&&e.click.call(this,n)}),r.on("scroll",function(){clearTimeout(n),n=setTimeout(function(){s()},100)}))},countdown:function(e,t,i){var n=this,a="function"==typeof t,o=new Date(e).getTime(),r=new Date(!t||a?(new Date).getTime():t).getTime(),l=o-r,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=t);var u=setTimeout(function(){n.countdown(e,r+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],t,u),l<=0&&clearTimeout(u),u},timeAgo:function(e,t){var i=this,n=[[],[]],a=(new Date).getTime()-new Date(e).getTime();return a>26784e5?(a=new Date(e),n[0][0]=i.digit(a.getFullYear(),4),n[0][1]=i.digit(a.getMonth()+1),n[0][2]=i.digit(a.getDate()),t||(n[1][0]=i.digit(a.getHours()),n[1][1]=i.digit(a.getMinutes()),n[1][2]=i.digit(a.getSeconds())),n[0].join("-")+" "+n[1].join(":")):a>=864e5?(a/1e3/60/60/24|0)+"天前":a>=36e5?(a/1e3/60/60|0)+"小时前":a>=18e4?(a/1e3/60|0)+"分钟前":a<0?"未来":"刚刚"},digit:function(e,t){var i="";e=String(e),t=t||2;for(var n=e.length;n/g,">").replace(/'/g,"'").replace(/"/g,""")},event:function(e,n,a){var o=t("body");return a=a||"click",n=i.event[e]=t.extend(!0,i.event[e],n)||{},i.event.UTIL_EVENT_CALLBACK=i.event.UTIL_EVENT_CALLBACK||{},o.off(a,"*["+e+"]",i.event.UTIL_EVENT_CALLBACK[e]),i.event.UTIL_EVENT_CALLBACK[e]=function(){var i=t(this),a=i.attr(e);"function"==typeof n[a]&&n[a].call(this,i)},o.on(a,"*["+e+"]",i.event.UTIL_EVENT_CALLBACK[e]),n}};!function(e,t,i){"$:nomunge";function n(){a=t[l](function(){o.each(function(){var t=e(this),i=t.width(),n=t.height(),a=e.data(this,u);(i!==a.w||n!==a.h)&&t.trigger(c,[a.w=i,a.h=n])}),n()},r[g])}var a,o=e([]),r=e.resize=e.extend(e.resize,{}),l="setTimeout",c="resize",u=c+"-special-event",g="delay",s="throttleWindow";r[g]=250,r[s]=!0,e.event.special[c]={setup:function(){if(!r[s]&&this[l])return!1;var t=e(this);o=o.add(t),e.data(this,u,{w:t.width(),h:t.height()}),1===o.length&&n()},teardown:function(){if(!r[s]&&this[l])return!1;var t=e(this);o=o.not(t),t.removeData(u),o.length||clearTimeout(a)},add:function(t){function n(t,n,o){var r=e(this),l=e.data(this,u)||{};l.w=n!==i?n:r.width(),l.h=o!==i?o:r.height(),a.apply(this,arguments)}if(!r[s]&&this[l])return!1;var a;return e.isFunction(t)?(a=t,n):(a=t.handler,void(t.handler=n))}}}(t,window),e("util",i)}); -------------------------------------------------------------------------------- /src/main/resources/static/layui/layui.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;!function(e){"use strict";var t=document,n={modules:{},status:{},timeout:10,event:{}},r=function(){this.v="2.5.6"},o=function(){var e=t.currentScript?t.currentScript.src:function(){for(var e,n=t.scripts,r=n.length-1,o=r;o>0;o--)if("interactive"===n[o].readyState){e=n[o].src;break}return e||n[r].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),a=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},i="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),u={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",transfer:"modules/transfer",tree:"modules/tree",table:"modules/table",element:"modules/element",rate:"modules/rate",colorpicker:"modules/colorpicker",slider:"modules/slider",carousel:"modules/carousel",flow:"modules/flow",util:"modules/util",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};r.prototype.cache=n,r.prototype.define=function(e,t){var r=this,o="function"==typeof e,a=function(){var e=function(e,t){layui[e]=t,n.status[e]=!0};return"function"==typeof t&&t(function(r,o){e(r,o),n.callback[r]=function(){t(e)}}),this};return o&&(t=e,e=[]),!layui["layui.all"]&&layui["layui.mobile"]?a.call(r):(r.use(e,a),r)},r.prototype.use=function(e,r,l){function c(e,t){var r="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||r.test((e.currentTarget||e.srcElement).readyState))&&(n.modules[d]=t,y.removeChild(h),function o(){return++m>1e3*n.timeout/4?a(d+" is not a valid module"):void(n.status[d]?s():setTimeout(o,4))}())}function s(){l.push(layui[d]),e.length>1?p.use(e.slice(1),r,l):"function"==typeof r&&r.apply(layui,l)}var p=this,f=n.dir=n.dir?n.dir:o,y=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(p.each(e,function(t,n){"jquery"===n&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var d=e[0],m=0;if(l=l||[],n.host=n.host||(f.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===e.length||layui["layui.all"]&&u[d]||!layui["layui.all"]&&layui["layui.mobile"]&&u[d])return s(),p;var v=(u[d]?f+"lay/":/^\{\/\}/.test(p.modules[d])?"":n.base||"")+(p.modules[d]||d)+".js";if(v=v.replace(/^\{\/\}/,""),!n.modules[d]&&layui[d]&&(n.modules[d]=v),n.modules[d])!function g(){return++m>1e3*n.timeout/4?a(d+" is not a valid module"):void("string"==typeof n.modules[d]&&n.status[d]?s():setTimeout(g,4))}();else{var h=t.createElement("script");h.async=!0,h.charset="utf-8",h.src=v+function(){var e=n.version===!0?n.v||(new Date).getTime():n.version||"";return e?"?v="+e:""}(),y.appendChild(h),!h.attachEvent||h.attachEvent.toString&&h.attachEvent.toString().indexOf("[native code")<0||i?h.addEventListener("load",function(e){c(e,v)},!1):h.attachEvent("onreadystatechange",function(e){c(e,v)}),n.modules[d]=v}return p},r.prototype.getStyle=function(t,n){var r=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return r[r.getPropertyValue?"getPropertyValue":"getAttribute"](n)},r.prototype.link=function(e,r,o){var i=this,u=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof r&&(o=r);var c=(o||e).replace(/\.|\//g,""),s=u.id="layuicss-"+c,p=0;return u.rel="stylesheet",u.href=e+(n.debug?"?v="+(new Date).getTime():""),u.media="all",t.getElementById(s)||l.appendChild(u),"function"!=typeof r?i:(function f(){return++p>1e3*n.timeout/100?a(e+" timeout"):void(1989===parseInt(i.getStyle(t.getElementById(s),"width"))?function(){r()}():setTimeout(f,100))}(),i)},n.callback={},r.prototype.factory=function(e){if(layui[e])return"function"==typeof n.callback[e]?n.callback[e]:null},r.prototype.addcss=function(e,t,r){return layui.link(n.dir+"css/"+e,t,r)},r.prototype.img=function(e,t,n){var r=new Image;return r.src=e,r.complete?t(r):(r.onload=function(){r.onload=null,"function"==typeof t&&t(r)},void(r.onerror=function(e){r.onerror=null,"function"==typeof n&&n(e)}))},r.prototype.config=function(e){e=e||{};for(var t in e)n[t]=e[t];return this},r.prototype.modules=function(){var e={};for(var t in u)e[t]=u[t];return e}(),r.prototype.extend=function(e){var t=this;e=e||{};for(var n in e)t[n]||t.modules[n]?a("模块名 "+n+" 已被占用"):t.modules[n]=e[n];return t},r.prototype.router=function(e){var t=this,e=e||location.hash,n={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(e=e.replace(/^#\//,""),n.href="/"+e,e=e.replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),n.search[t[0]]=t[1]}():n.path.push(t)}),n):n},r.prototype.url=function(e){var t=this,n={pathname:function(){var t=e?function(){var t=(e.match(/\.[^.]+?\/.+/)||[])[0]||"";return t.replace(/^[^\/]+/,"").replace(/\?.+/,"")}():location.pathname;return t.replace(/^\//,"").split("/")}(),search:function(){var n={},r=(e?function(){var t=(e.match(/\?.+/)||[])[0]||"";return t.replace(/\#.+/,"")}():location.search).replace(/^\?+/,"").split("&");return t.each(r,function(e,t){var r=t.indexOf("="),o=function(){return r<0?t.substr(0,t.length):0!==r&&t.substr(0,r)}();o&&(n[o]=r>0?t.substr(r+1):null)}),n}(),hash:t.router(function(){return e?(e.match(/#.+/)||[])[0]||"":location.hash}())};return n},r.prototype.data=function(t,n,r){if(t=t||"layui",r=r||localStorage,e.JSON&&e.JSON.parse){if(null===n)return delete r[t];n="object"==typeof n?n:{key:n};try{var o=JSON.parse(r[t])}catch(a){var o={}}return"value"in n&&(o[n.key]=n.value),n.remove&&delete o[n.key],r[t]=JSON.stringify(o),n.key?o[n.key]:o}},r.prototype.sessionData=function(e,t){return this.data(e,t,sessionStorage)},r.prototype.device=function(t){var n=navigator.userAgent.toLowerCase(),r=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return e=(n.match(t)||[])[1],e||!1},o={os:function(){return/windows/.test(n)?"windows":/linux/.test(n)?"linux":/iphone|ipod|ipad|ios/.test(n)?"ios":/mac/.test(n)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((n.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:r("micromessenger")};return t&&!o[t]&&(o[t]=r(t)),o.android=/android/.test(n),o.ios="ios"===o.os,o.mobile=!(!o.android&&!o.ios),o},r.prototype.hint=function(){return{error:a}},r.prototype.each=function(e,t){var n,r=this;if("function"!=typeof t)return r;if(e=e||[],e.constructor===Object){for(n in e)if(t.call(e[n],n,e[n]))break}else for(n=0;na?1:o 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 |

      大会员看到的界面

      10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/templates/shiro/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 |

      index

      10 |
      11 | 退出 12 |
      13 | 游客
      14 |
      15 | 会员 16 | 发送邮件 17 |
      18 |
      19 | 大会员 20 | 发送邮件 21 |
      22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/templates/shiro/main.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 |

      游客看到的界面

      10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/templates/shiro/manage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 |

      会员看到的界面

      10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/templates/test2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 狂神说 6 | 7 | 8 |

      测试页面

      9 | 10 | 11 |
      12 | 13 |
      14 | 15 | 16 | 17 |

      18 | 19 |

      20 | 21 | [[${user}]] 22 |

      23 | 24 | 25 | -------------------------------------------------------------------------------- /src/test/java/com/daq/springboot/SpringbootApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot; 2 | 3 | import com.alibaba.druid.pool.DruidDataSource; 4 | import com.daq.springboot.utils.MailUtil; 5 | import com.daq.springboot.utils.QRCodeUtil; 6 | import org.junit.jupiter.api.Test; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.boot.test.context.SpringBootTest; 9 | import org.springframework.data.redis.core.RedisTemplate; 10 | 11 | import javax.sql.DataSource; 12 | import java.sql.Connection; 13 | import java.sql.SQLException; 14 | 15 | 16 | @SpringBootTest 17 | class SpringbootApplicationTests { 18 | 19 | @Autowired 20 | MailUtil mailUtil; 21 | 22 | @Autowired 23 | DataSource dataSource; 24 | 25 | @Autowired 26 | private RedisTemplate redisTemplate; 27 | 28 | @Test 29 | void testDatasource() throws SQLException { 30 | //看一下默认数据源 31 | System.out.println(dataSource.getClass()); 32 | //获得连接 33 | Connection connection = null; 34 | try { 35 | connection = dataSource.getConnection(); 36 | System.out.println(connection); 37 | DruidDataSource druidDataSource = (DruidDataSource) dataSource; 38 | System.out.println("druidDataSource 数据源最大连接数:" + druidDataSource.getMaxActive()); 39 | System.out.println("druidDataSource 数据源初始化连接数:" + druidDataSource.getInitialSize()); 40 | } catch (SQLException throwables) { 41 | throwables.printStackTrace(); 42 | } finally { 43 | //关闭连接 44 | connection.close(); 45 | } 46 | } 47 | 48 | @Test 49 | void testReids(){ 50 | redisTemplate.opsForValue().set("key1","value1"); 51 | redisTemplate.opsForValue().get("key1"); 52 | } 53 | 54 | @Test 55 | void testMail(){ 56 | String[] to = {"2829025551@qq.com"}; 57 | mailUtil.sendHtmlMail("dierci","taihaole",to); 58 | } 59 | @Test 60 | void testQr() throws Exception { 61 | QRCodeUtil.shengcheng("nihoa","G:\\LogFile\\daq121.jpg"); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/test/java/com/daq/springboot/demo/service/AccountServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.demo.service; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | 7 | @SpringBootTest 8 | class AccountServiceTest { 9 | 10 | @Autowired 11 | private AccountService accountService; 12 | 13 | @Test 14 | void findByUsername() { 15 | System.out.println(accountService.findByUsername("ls")); 16 | } 17 | } -------------------------------------------------------------------------------- /src/test/java/com/daq/springboot/demo/service/test.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot.demo.service; 2 | 3 | import org.springframework.scheduling.annotation.EnableScheduling; 4 | import org.springframework.scheduling.annotation.Scheduled; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * @author 9 | * @description 10 | */ 11 | @Component 12 | @EnableScheduling 13 | public class test{ 14 | 15 | @Scheduled(cron = "0/2 * * * * ?") 16 | public void testCron(){ 17 | System.out.println("你被执行了!!!!"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/test/java/com/daq/springboot/logTest.java: -------------------------------------------------------------------------------- 1 | package com.daq.springboot; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | 10 | @RunWith(SpringRunner.class) 11 | @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) 12 | public class logTest { 13 | private Logger logger = LoggerFactory.getLogger(this.getClass()); 14 | @Test 15 | public void testLog() { 16 | logger.error("用户为绑定就开始缴费"); 17 | } 18 | } 19 | --------------------------------------------------------------------------------