![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
springboot学习
文章平均质量分 89
一起喜羊羊
这个作者很懒,什么都没留下…
展开
-
springboot下shiro和jwt的整合使用
首先shiro做安全框架,将JWT整合到shiro的认证和授权中进行使用,最终的目的就是用户在进行登录的时候,验证成功则返回一个token,后面该用户可以通过这个token是访问自己有权限的接口,启动缓存功能,只有第一次认证需要查询DB,后续访问都是访问缓存(分两种,单机版应用使用EhCache,分布式使用redis)整合思路:1.构建一个springBoot项目,引入核心依赖并展示核心代码目录 <!--引入ehcache依赖(单机版本缓存用) --> <depen原创 2021-06-18 21:34:06 · 2284 阅读 · 3 评论 -
使用springMVC实现上传下载图片
上传多张图片代码:public static final String PICTUREURL = "/mnt/pic/";//图片路径public static final String PC_PICTUREURL = "E:\\pic";//图片路径@RequestMapping("/uploadPics.do") public RetObj uploadPics(@Param("file") MultipartFile[] files,@Param("trendId") Integer原创 2020-05-16 10:30:08 · 1088 阅读 · 0 评论 -
Spring boot 下redis缓存的使用@EnableCaching、@CacheConfig、@Cacheable、@CacheEvict、@CachePut
使用redis缓存数据库首先先在项目Application类上添加@EnableCaching注解,作用是使缓存生效在要用缓存的类上添加@CacheConfig(cacheNames = “product”),相当于作用域是product在类中要使用缓存的方法上添加@Cacheable(key = "#sellerId",condition = "#sellerId.length() &g...原创 2019-07-05 11:46:22 · 1835 阅读 · 0 评论 -
Spring boot 下WebSocket的使用
前端js代码:<script> var websocket = null; if('WebSocket' in window) { websocket = new WebSocket('ws://localhost:8080/sell/webSocket'); }else { alert('该浏览器不支持websocket!')...原创 2019-07-06 22:34:41 · 109 阅读 · 0 评论