| | |
| | | package com.xcong.farmer.cms.configurations.security; |
| | | |
| | | import com.xcong.farmer.cms.configurations.WebMvcConfig; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.boot.autoconfigure.AutoConfigureAfter; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.http.HttpMethod; |
| | |
| | | * @date 2020-05-11 |
| | | **/ |
| | | @Slf4j |
| | | @AutoConfigureAfter(WebMvcConfig.class) |
| | | @Configuration |
| | | @EnableWebSecurity |
| | | @EnableGlobalMethodSecurity(prePostEnabled = true) |
| | |
| | | @Resource |
| | | private UserDetailsService userDetailsService; |
| | | |
| | | |
| | | @Override |
| | | protected void configure(HttpSecurity http) throws Exception { |
| | | System.out.println(444444); |
| | | http.httpBasic().and(). |
| | | cors().and().csrf().disable() |
| | | .exceptionHandling().authenticationEntryPoint(authenticationEntryPoint()) |
| | |
| | | } |
| | | |
| | | public TokenConfigurer securityConfiguereAdapter() { |
| | | System.out.println(33333333); |
| | | return new TokenConfigurer(); |
| | | } |
| | | } |