优化登录逻辑
This commit is contained in:
parent
9b3945240a
commit
0e687e242d
|
@ -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")));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -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
|
||||||
|
|
|
@ -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"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user