- 博客(8)
- 收藏
- 关注

原创 Springboot+Thymeleaf环境搭建与简单应用
1,环境搭建 pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/ma
2020-10-07 17:49:02
296
2
原创 springboot+springsecurity跨域配置完整版(俺被坑了一个上午,特此前来用爱发电)
springboot跨域配置不必多说,网上很多: 首先配置好,我用的是继承WebMvcConfigurer配置,还可以通过过滤器配置,我觉得这样应该是最方便了,缺点就是这种配置不能在interceptor中再配置header。 @Configuration public class MyWebConfigurer implements WebMvcConfigurer { @Autowired private LoginInterceptor loginInterceptor;
2021-02-05 16:04:50
793
转载 Springboot+springsecurity+jwt实现认证授权和权限管理
原文: https://blog.csdn.net/ech13an/article/details/80779973 思路: 搭建springboot工程 导入springSecurity跟jwt的依赖 用户的实体类 dao层 service层(真正开发时再写,这里就直接调用dao层操作数据库) 实现UserDetailsService接口 实现UserDetails接口 验证用户登录信息的拦截器 验证用户权限的拦截器 springSecurity配置 认证的Controller以及测试的controll
2021-02-04 23:00:30
545
转载 Springboot跨域失败,配置无效,原因出自SpringSecurity!
虽然我们在WebMvcConfigurer中设置跨域,但是如果WebSecurityConfigurerAdapter中不设置http.cors(),会导致一个的问题: 如果一个需要被spring security过滤器验证的请求,比如对url“/getInfo”的请求,如果这个请求没有通过验证,比如没有携带token或token不正确, 导致没有给该请求发放authentication,那么这个请求会在后续的Authentication过滤器中被认定鉴权失败,直接返回response给客户端。 这种情况下
2021-02-02 20:10:54
1675
转载 Springboot整合springsecurity详细代码!非常通俗易懂
注重版权,转载请注明原作者和原文链接 作者:码农BookSea 原文链接: https://blog.csdn.net/bookssea/article/details/109262109 User类 @Data public class User { private Integer uid; private String username; private String password; } Role类 @Data public class Role { privat
2021-01-26 12:13:51
345
转载 Springboot配置SpringMVC静态资源路径的配置
Spring boot通过WebMvcConfigurer接口配置静态资源访问路径 @Configuration public class MyWebAppConfiguration implements WebMvcConfigurer { @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { //和页面有关的静态目录都放在项目的static目录下
2020-10-11 10:02:57
473
原创 C++实现计算简单定积分函数
#include "StdAfx.h" #include <iostream> #include <cmath> using namespace std; //根据最简单的定积分算法,编写一个定积分函数 //实现不同函数的定积分,利用函数指针作为形参 typedef double (*PF)(double x); //a,b,n,fun double Integral(double a,double b,int n, PF fun) { double step=(b-a)/
2020-09-25 22:12:08
4988
转载 Linux下运行,Tomcat开启后,页面一直加载,关闭Tomcat时报错Catalina.stop
查了很多博客的资料,这可能是jdk下的/jre/lib/security/java.security文件的一个问题。 找到文件后,在文件中找到securerandom.source这个设置项,将其改为: securerandom.source=file:/dev/./urandom 就可以了。 博客资料详情:https://blog.csdn.net/njchenyi/article/detail...
2020-02-04 15:40:01
1032
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人