zoukankan      html  css  js  c++  java
  • Spring Security登录没反应

    今天代码写错了,自己看了1个半小时,啥都没发现,还是找的同学才看出来。

    //    @Override
    //    protected void configure(HttpSecurity http) throws Exception {
    //        http.authorizeRequests()
    //                .anyRequest().authenticated()
    //                .and()
    //                .formLogin().loginPage("/login")
    //                .defaultSuccessUrl("/").permitAll()
    //                .and()
    //                .logout().permitAll();
    //        http.cors().disable();
    //    }
    
        @Override
        protected void configure(HttpSecurity http) throws Exception {
            http.authorizeRequests()
                    .anyRequest().authenticated()
                    .and()
                    .formLogin().loginPage("/login")
                    .defaultSuccessUrl("/").permitAll()
                    .and()
                    .logout().permitAll();
            http.csrf().disable();
        }

    http.csrf().disable()写成了http.cors().disable()

  • 相关阅读:
    java8
    java7
    java6
    java5
    java复习4
    学习笔记
    Reflection笔记
    通过Reflection来获得方法和信息
    學習反射2
    學習反射1
  • 原文地址:https://www.cnblogs.com/woyujiezhen/p/13062666.html
Copyright © 2011-2022 走看看