故事 最近一直在加班,之前也没用国Oauth2进行权限控制,然后有点懵逼,导致配置了Swagger无法进行访问。无法访问包括: 1、页面无法访问 2、页面可以访问,访问接口报401没得权限 解决方法 解决页面访问问题 由于配置了Oauth2,因此需要对ResourceServerConfigurerAdapter中的configure方法进行重写一下 具体内容如下: import com.yth.oauth.component.YthUserAuthenticationConverter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.oauth2.conf.... Swagger2+Oauth2导致无法访问页面无法请求 待分类