Ver código fonte

忘记密码接口 开放权限

785834757 1 ano atrás
pai
commit
efd167206c

+ 1 - 1
authentication/src/main/java/com/jzg/config/SecurityConfig.java

@@ -83,7 +83,7 @@ public class SecurityConfig {
         http.authorizeHttpRequests(auth -> auth
         http.authorizeHttpRequests(auth -> auth
                         .requestMatchers("/swagger-ui/**", "/v3/api-docs/**", "/swagger-resources/**", "/webjars/**", "/favicon.ico",
                         .requestMatchers("/swagger-ui/**", "/v3/api-docs/**", "/swagger-resources/**", "/webjars/**", "/favicon.ico",
                                 "/auth/login","/auth/captchaById","/auth/register","/sendSmsCode","/appLogin","/smsCodeLogin","/auth/publicKeyExchange","/appAuth/smsCodeLogin","/send/sendSmsCode",
                                 "/auth/login","/auth/captchaById","/auth/register","/sendSmsCode","/appLogin","/smsCodeLogin","/auth/publicKeyExchange","/appAuth/smsCodeLogin","/send/sendSmsCode",
-                                "/appAuth/appLogin","/auth/sendSmsCode").permitAll()
+                                "/appAuth/appLogin","/auth/sendSmsCode","/auth/forgotPassword").permitAll()
                         .anyRequest().authenticated()  // 其他接口需认证
                         .anyRequest().authenticated()  // 其他接口需认证
                 )
                 )
 //                .formLogin((form) -> form
 //                .formLogin((form) -> form

+ 1 - 0
authentication/src/main/java/com/jzg/filter/TokenAuthenticationFilter.java

@@ -48,6 +48,7 @@ public class TokenAuthenticationFilter extends OncePerRequestFilter {
         doList.add("/appAuth/smsCodeLogin");
         doList.add("/appAuth/smsCodeLogin");
         doList.add("/appAuth/appLogin");
         doList.add("/appAuth/appLogin");
         doList.add("/auth/sendSmsCode");
         doList.add("/auth/sendSmsCode");
+        doList.add("/auth/forgotPassword");
         String path = request.getRequestURI();
         String path = request.getRequestURI();
         for (String pattern : doList) {
         for (String pattern : doList) {
             // 使用正则表达式匹配  .* 匹配所有以 pattern 开头的路径
             // 使用正则表达式匹配  .* 匹配所有以 pattern 开头的路径