<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # 1. 編寫配置類 ``` @Configuration public class SecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http .formLogin()// 自定義的登錄頁面 .loginPage("/login.html")// 登錄頁面 .loginProcessingUrl("/user/login") // 登錄的路徑地址 不需要自己寫 .defaultSuccessUrl("/index")// 登錄成功跳轉的路徑 // .usernameParameter("username") // 登錄頁面用戶名參數名 // .passwordParameter("password") // 登錄密碼 參數名 // .failureForwardUrl("/sb") // 登錄失敗跳轉頁面 因為請求是post前端不會跳轉 .failureUrl("/sb") // 登錄失敗跳轉 .permitAll()// 允許操作 .and() .authorizeRequests() // 授權 .antMatchers("/login.html", "/user/login", "/sb") // 設置那些路徑可以直接訪問 不需要認證 .permitAll() // 允許操作 .anyRequest() // 任何請求 .authenticated() // 任何請求 都需要認證 .and() .csrf() // 跨域請求 .disable();// 關閉 } @Bean public PasswordEncoder passwordEncoder(){ return new BCryptPasswordEncoder(); } } ``` # 2.編寫頁面 (在resources/static) 創建 login.html ``` <form action="/user/login" method="post"> 用戶名: <input type="text" name="username"> <br/> 密碼: <input type="password" name="password"> <br/> <input type="submit" value="登錄"> </form> ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看