陶杰
2024-12-24 f80cb569e078e7494e6701f74064f41e52b7c19f
1.微信登录
已修改2个文件
15 ■■■■ 文件已修改
src/main/java/com/mzl/flower/config/ResourceServerConfig.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/config/security/provider/UserIdAuthenticationProvider.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/config/ResourceServerConfig.java
@@ -37,6 +37,7 @@
        httpSecurity
                .authorizeRequests()
                .antMatchers("/api/login/**").permitAll()
                .antMatchers("/api/wx/jscode2session").permitAll()
                .antMatchers("/api/pub/**").permitAll()
                .antMatchers("/api/advertisement/**").permitAll()
                .antMatchers("/api/ua/**").permitAll()
src/main/java/com/mzl/flower/config/security/provider/UserIdAuthenticationProvider.java
@@ -20,13 +20,13 @@
    @Override
    protected void additionalAuthenticationChecks(UserDetails userDetails, Authentication authentication) throws AuthenticationException {
        if (authentication.getCredentials() == null) {
            log.debug("Authentication failed: no credentials provided");
            throw new BadCredentialsException(messages.getMessage(
                    "AbstractUserDetailsAuthenticationProvider.badCredentials",
                    "Bad credentials"));
        }
//        if (authentication.getCredentials() == null) {
//            log.debug("Authentication failed: no credentials provided");
//
//            throw new BadCredentialsException(messages.getMessage(
//                    "AbstractUserDetailsAuthenticationProvider.badCredentials",
//                    "Bad credentials"));
//        }
    }
    @Override