03 2018 档案

摘要:继承WebMvcConfigurerAdapter类,重写类中的方法,可以增加额外的配置 @Configuration public class WebMvcConfig extends WebMvcConfigurerAdapter{ /** * 配置静态访问资源 * @param registry */ @Override public... 阅读全文
posted @ 2018-03-26 14:04 白白胖胖萌 阅读(186) 评论(0) 推荐(0)
摘要:/** * 对字符串md5加密(小写+数字) * * @param str 传入要加密的字符串 * @return MD5加密后的字符串 */ public static String getMD5(String str) { try { // 生成一个MD5加密计算摘要 ... 阅读全文
posted @ 2018-03-26 09:38 白白胖胖萌 阅读(147) 评论(0) 推荐(0)
摘要:security的依赖 配置一下application.properties 创建一个SysUser(用户类),实现UserDetails类,重写里面的方法。 注意属性名字只能是username和password. 然后写一个service和数据层 写一个WebSecurityConfig 三个页面 阅读全文
posted @ 2018-03-23 17:13 白白胖胖萌 阅读(569) 评论(1) 推荐(0)
摘要:跳转页面需要加上模版依赖:<!--thymeleaf--><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId></dependen 阅读全文
posted @ 2018-03-21 18:01 白白胖胖萌 阅读(416) 评论(0) 推荐(0)
摘要:记录一下今天搭建spring boot项目的过程 File New Project Spring Initializr -- next 这里可以全部默认,或者自己更改下名字 这里可以勾选web,然后根据自己需要勾选,我这里选了JPA,MySql,MyBatis。 next Finish-- 这样sp 阅读全文
posted @ 2018-03-20 17:58 白白胖胖萌 阅读(703) 评论(0) 推荐(0)