- 博客(4)
- 收藏
- 关注
原创 Mybatis-plus无法分页PG数据库
IPage<TbUser> page=new Page<>(currentPage,currentSize); page = userMapper.selectPage(page, new QueryWrapper<>()); 上述代码在使用过程稿无法分页 导出全部数据 加入相关配置即可分页 @Configuration //@MapperScan("com.jack.db.mapper") public class MybatisPlusCon.
2022-04-01 16:54:28 1185
原创 Springboot配置拦截器之后前端出线跨域情况
原因是我们配置的拦截器优先级比之前配置的跨域配置优先级要高,请求还没有进入接口就已经被返回的话就无法进行跨域配置。 解决方案:配置一下让拦截器的优先级变低 import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.cors.CorsConfiguration; impo
2022-02-11 13:49:02 491
原创 SpringBoot生成登录验证码
@GetMapping("/verifyCode") public void verifyCode(HttpServletRequest request, HttpServletResponse resp) throws IOException { VerificationCode code = new VerificationCode(); BufferedImage image = code.getImage(); String text =...
2022-01-26 08:56:56 838
原创 SpringBoot配置拦截器
类似一些token校验在每个service里面都要进行校验的重复代码。我们可以直接在Springboot里面配置一个拦截器,这样不用每次都重写代码。 拦截类 集成HandlerInterceptor接口 配置 拦截路径 这样一来每次我们访问以admin开头的接口都会先经过我们上面写的实体类的方法。 源码:追风考试系统 vue+springboot: 追风考试系统是一个基于 VueCli + springboot的前后端分离项目 - Gitee.com ...
2022-01-25 16:20:32 818
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人