优化登录逻辑

This commit is contained in:
阿沐 2022-05-27 19:43:49 +08:00
parent 9b3945240a
commit 0e687e242d
6 changed files with 9 additions and 7 deletions

View File

@ -11,7 +11,7 @@ import org.springframework.context.annotation.Configuration;
/** /**
* Swagger配置 * Swagger配置
* *
* @author 阿沐 dolinked@qq.com * @author 阿沐 babamu@126.com
*/ */
@Configuration @Configuration
public class SwaggerConfig{ public class SwaggerConfig{
@ -35,9 +35,9 @@ public class SwaggerConfig{
.description( "FastBoot") .description( "FastBoot")
.contact(contact) .contact(contact)
.version("1.0") .version("1.0")
.termsOfService("https://gitee.com/makunet") .termsOfService("https://maku.net")
.license(new License().name("MIT") .license(new License().name("MIT")
.url("https://gitee.com/makunet"))); .url("https://maku.net")));
} }
} }

View File

@ -56,6 +56,8 @@ public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdap
endpoints.exceptionTranslator(new FastWebResponseExceptionTranslator()); endpoints.exceptionTranslator(new FastWebResponseExceptionTranslator());
// 配置授权码模式存放在Redis中 // 配置授权码模式存放在Redis中
endpoints.authorizationCodeServices(redisAuthorizationCodeServices); endpoints.authorizationCodeServices(redisAuthorizationCodeServices);
// 自定义登录地址
endpoints.pathMapping("/oauth/token","/sys/oauth/token");
} }
@Bean @Bean

View File

@ -18,6 +18,6 @@ public class PermitResource {
"/swagger-ui.html", "/swagger-ui.html",
"/swagger-ui/**", "/swagger-ui/**",
"/doc.html", "/doc.html",
"/oauth/captcha" "/sys/oauth/captcha"
}; };
} }

View File

@ -22,7 +22,7 @@ import java.io.IOException;
@Component @Component
@AllArgsConstructor @AllArgsConstructor
public class ValidateCodeFilter extends OncePerRequestFilter { public class ValidateCodeFilter extends OncePerRequestFilter {
private final static String OAUTH_TOKEN_URL = "/oauth/token"; private final static String OAUTH_TOKEN_URL = "/sys/oauth/token";
private final CaptchaService captchaService; private final CaptchaService captchaService;
private final UserAuthenticationFailureHandler authenticationFailureHandler; private final UserAuthenticationFailureHandler authenticationFailureHandler;

View File

@ -25,7 +25,7 @@ import java.util.Map;
* @author 阿沐 babamu@126.com * @author 阿沐 babamu@126.com
*/ */
@RestController @RestController
@RequestMapping("oauth") @RequestMapping("sys/oauth")
@Tag(name="认证管理") @Tag(name="认证管理")
@AllArgsConstructor @AllArgsConstructor
public class SysOauthController { public class SysOauthController {

View File

@ -8,7 +8,7 @@
<name>fast-boot</name> <name>fast-boot</name>
<description>FastBoot</description> <description>FastBoot</description>
<url>https://gitee.com/makunet</url> <url>https://maku.net</url>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>