{"id":38262,"date":"2023-12-11T14:43:56","date_gmt":"2023-12-11T06:43:56","guid":{"rendered":"https:\/\/wx.kaifamiao.info\/?p=38262"},"modified":"2023-12-11T14:43:56","modified_gmt":"2023-12-11T06:43:56","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8spring-boot%e5%ba%94%e7%94%a8%e7%a8%8b%e5%ba%8f%e4%b8%ad%e5%ae%9e%e7%8e%b0spring%e5%ae%89%e5%85%a8%e6%80%a7%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/wx.kaifamiao.info\/index.php\/2023\/12\/11\/%e5%a6%82%e4%bd%95%e5%9c%a8spring-boot%e5%ba%94%e7%94%a8%e7%a8%8b%e5%ba%8f%e4%b8%ad%e5%ae%9e%e7%8e%b0spring%e5%ae%89%e5%85%a8%e6%80%a7%ef%bc%9f\/","title":{"rendered":"\u5982\u4f55\u5728Spring Boot\u5e94\u7528\u7a0b\u5e8f\u4e2d\u5b9e\u73b0Spring\u5b89\u5168\u6027\uff1f"},"content":{"rendered":"<p>&#8220;`&#8221;<\/p>\n<p>\u5b9e\u65bd\u9700\u8981\u6700\u5c11\u7684\u914d\u7f6e\u3002\u60a8\u9700\u8981\u505a\u7684\u5c31\u662fspring-boot-starter-security\u5728pom.xml\u6587\u4ef6\u4e2d\u6dfb\u52a0starter\u3002\u60a8\u8fd8\u9700\u8981\u521b\u5efa\u4e00\u4e2aSpring\u914d\u7f6e\u7c7b\uff0c\u5b83\u5c06\u8986\u76d6\u6240\u9700\u7684\u65b9\u6cd5\uff0c\u540c\u65f6\u6269\u5c55 WebSecurityConfigurerAdapter \u5e94\u7528\u7a0b\u5e8f\u4e2d\u7684\u5b89\u5168\u6027\u3002\u8fd9\u662f\u4e00\u4e9b\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<p>&lt;pre&gt;&lt;code class=&quot;&quot;language-java&quot;&quot; lang=&quot;&quot;java&quot;&quot;&gt;package com.gkatzioura.security.securityendpoints.config;<br \/>\nimport org.springframework.context.annotation.Configuration;<br \/>\nimport org.springframework.security.config.annotation.web.builders.HttpSecurity;<br \/>\nimport org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;<br \/>\n@Configuration<br \/>\npublic class SecurityConfig extends WebSecurityConfigurerAdapter {<br \/>\n@Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests() .antMatchers(&quot;&quot;\/welcome&quot;&quot;).permitAll() .anyRequest().authenticated() .and() .formLogin() .permitAll() .and() .logout() .permitAll();<br \/>\n}<br \/>\n}<br \/>\n&lt;\/code&gt;&lt;\/pre&gt;<\/p>\n<p>\u00a0<\/p>\n<p>&lt;pre&gt;&lt;code&gt;            &quot;&#8220;`<br \/>\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;`&#8221; \u5b9e\u65bd\u9700\u8981\u6700\u5c11\u7684\u914d\u7f6e\u3002\u60a8\u9700\u8981\u505a\u7684\u5c31\u662fspring-boot-starter-se [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-38262","post","type-post","status-publish","format-standard","hentry","category-c"],"_links":{"self":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/38262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/comments?post=38262"}],"version-history":[{"count":1,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/38262\/revisions"}],"predecessor-version":[{"id":38263,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/38262\/revisions\/38263"}],"wp:attachment":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/media?parent=38262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/categories?post=38262"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/tags?post=38262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}