feat: 登录授权接口
This commit is contained in:
@ -35,6 +35,9 @@
|
||||
<artifactId>lombok</artifactId>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
@ -7,6 +7,11 @@ public class BusinessException extends RuntimeException {
|
||||
|
||||
private final int code;
|
||||
|
||||
public BusinessException(String message) {
|
||||
super(message);
|
||||
this.code = 500;
|
||||
}
|
||||
|
||||
public BusinessException(int code, String message) {
|
||||
super(message);
|
||||
this.code = code;
|
||||
|
||||
@ -43,6 +43,9 @@
|
||||
<artifactId>lombok</artifactId>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
@ -52,6 +52,9 @@
|
||||
<artifactId>lombok</artifactId>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
@ -43,7 +43,7 @@ public class AuthorityIgnoreInitializer implements ApplicationContextAware {
|
||||
return s.startsWith("/") ? prefixUrl + s : prefixUrl + "/" + s;
|
||||
})
|
||||
.map(IgnoreUrl::new)
|
||||
.forEach(url -> this.ignoreUrls.add(url));
|
||||
.forEach(this.ignoreUrls::add);
|
||||
}
|
||||
|
||||
for (RequestMappingInfo mappingInfo : handlerMethods.keySet()) {
|
||||
@ -59,9 +59,6 @@ public class AuthorityIgnoreInitializer implements ApplicationContextAware {
|
||||
continue;
|
||||
}
|
||||
|
||||
System.out.println("beanClass:" + beanClass.getCanonicalName());
|
||||
System.out.println("method:" + handlerMethod.getMethod().getName() + " -> " + mappingInfo.getPatternValues());
|
||||
|
||||
List<String> urlPrefix = Arrays.stream(requestMapping.method())
|
||||
.map(RequestMethod::name)
|
||||
.map(StringBuffer::new)
|
||||
@ -81,9 +78,7 @@ public class AuthorityIgnoreInitializer implements ApplicationContextAware {
|
||||
urlPrefix.stream()
|
||||
.flatMap(sub -> mappingInfo.getPatternValues().stream().filter(StringUtils::hasText).map(s -> sub + s))
|
||||
.map(IgnoreUrl::new)
|
||||
.forEach(url -> this.ignoreUrls.add(url));
|
||||
|
||||
System.out.println("ignoreUrls: " + ignoreUrls);
|
||||
.forEach(this.ignoreUrls::add);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
package day.gitlab.dolphin.common.security.jwt;
|
||||
|
||||
import day.gitlab.dolphin.common.security.config.SecurityConfig;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class JwtInfo extends Jwt {
|
||||
|
||||
public JwtInfo(SecurityConfig securityConfig) {
|
||||
super(securityConfig.getSecret(), securityConfig.getExpire(), securityConfig.getRefreshTokenExpire());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user