同步操作将从 mes/MES-MOM 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
package com.songpeng.common.config.security;import com.songpeng.system.service.impl.SysUserServiceImpl;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;import org.springframework.security.config.annotation.web.builders.HttpSecurity;import org.springframework.security.config.annotation.web.builders.WebSecurity;import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;import org.springframework.security.core.userdetails.UserDetailsService;import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;import org.springframework.security.crypto.password.PasswordEncoder;/*** Controller** @author songpeng* @date 2019年5月23日*/@Configuration@EnableWebSecuritypublic class WebSecurityConfig extends WebSecurityConfigurerAdapter {@Beanpublic PasswordEncoder passwordEncoder() {return new BCryptPasswordEncoder();}/*** 注册UserDetailsService 的bean** @return*/@BeanUserDetailsService customUserService() {return new SysUserServiceImpl();}@Overrideprotected void configure(AuthenticationManagerBuilder auth) throws Exception {// 用户认证// 使用加密验证auth.userDetailsService(customUserService()).passwordEncoder(passwordEncoder());}@Overridepublic void configure(WebSecurity web) {web.ignoring().antMatchers("/css/**", "/fonts/**", "/img/**", "/js/**", "/lib/**", "/favicon.ico", "/blog", "/", "/sign_in");}@Overrideprotected void configure(HttpSecurity http) throws Exception {// TODO 1. csrf 暂时关闭http.headers().and().authorizeRequests().antMatchers("/registry").permitAll().anyRequest().authenticated().and().formLogin().loginPage("/sign_in").loginProcessingUrl("/login").defaultSuccessUrl("/personal_center", true).failureUrl("/sign_in?error").permitAll().and().sessionManagement().invalidSessionUrl("/sign_in").and().rememberMe().tokenValiditySeconds(1209600).and().logout().logoutSuccessUrl("/sign_in").permitAll().and().csrf().disable();}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。