springboot
宝藏程序员
这个作者很懒,什么都没留下…
展开
-
There was an unexpected error (type=Not Found, status=404)
报错:There was an unexpected error (type=Not Found, status=404)问题:springboot项目启动,访问接口报错,可能时类没有被扫描到解决方法:在application类中添加包扫描,代码如下:@ComponentScan("com.example.*")...原创 2021-10-18 11:24:07 · 584 阅读 · 0 评论 -
springboot 2.4版本 前后端分离 携带cookie跨域问题
解决方法:创建一个跨域配置类重点:将.allowedOrigins替换成.allowedOriginPatterns/** *跨域配置 **/@Configurationpublic class CorsConfig { @Bean public WebMvcConfigurer corsConfigurer() { return new WebMvcConfigurer() { @Override public v原创 2021-04-08 17:52:41 · 219 阅读 · 0 评论 -
springboot整合shiro实现用户认证
1.向pom.xml文件引入shiro依赖 <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-spring</artifactId> <version>1.7.1</version> </dependency>2.新建shiroConfig配置类@Configurationpublic class原创 2021-04-08 00:10:15 · 62 阅读 · 0 评论