springboot2 Use front and back separation ,token Put in header Configuration for validation

be careful registry.addInterceptor(new MyInterceptorConfig ());
Cannot add , otherwise header lower token Sometimes it's not available
@Configuration public class MyWebMvcConfigurer implements WebMvcConfigurer {
@Override public void addCorsMappings(CorsRegistry registry) { // Set the path that allows cross domain access
registry.addMapping("/**") // Set the domain name that allows cross domain requests .allowedOrigins("*")
.allowedHeaders("*") // .allowCredentials(true)// Allow certificate No longer on by default // Set allowed methods
.allowedMethods("GET", "POST", "PUT", "DELETE"); // .maxAge(3600);// Cross domain allowed time }
@Override public void addInterceptors(InterceptorRegistry registry) { //
registry.addInterceptor(new MyInterceptorConfig ()).addPathPatterns("/**");; } }
The following validation token
@Configuration public class MyInterceptorConfig implements HandlerInterceptor
{ public boolean preHandle(HttpServletRequest request, HttpServletResponse
resp, Object handler) throws Exception { String token =
request.getHeader("token"); ...

©2019-2020 Toolsou All rights reserved,
tkinter Implementation of user login interface Vue Invalid render dynamic component in subcomponent ( First invalid , Valid for the second time )9 ride 9 Sudoku C/C++ Memory model TypeScript actual combat -12-TS The mechanism of type checking - Type inference Java Thread safety and insecurity JLink,STLink,DAPLink,CMSIS DAP Differences in use Chapter 10 use SpringMVC Frame transformation of supermarket order management system -1C Language calculation of deposit interest About the Blue Bridge Cup , Things you should know !