mirror of
https://gitee.com/wangkang/udf.git
synced 2026-10-26 19:45:10 +00:00
更新
This commit is contained in:
-18
@@ -2,11 +2,8 @@ package org.itkk.udf.auth.filter.client;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.itkk.udf.auth.Constant;
|
||||
import org.itkk.udf.auth.IUserAuthenticationService;
|
||||
import org.itkk.udf.auth.UserType;
|
||||
import org.itkk.udf.auth.filter.AbstractBaseZuulFilter;
|
||||
import org.itkk.udf.core.exception.SystemRuntimeException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.cloud.netflix.zuul.filters.support.FilterConstants;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -19,24 +16,9 @@ import org.springframework.stereotype.Component;
|
||||
@ConditionalOnProperty(value = "org.itkk.auth.filter.client.identity.enabled", matchIfMissing = true)
|
||||
public class ClientIdentityFilter extends AbstractBaseZuulFilter {
|
||||
|
||||
/**
|
||||
* userAuthenticationService
|
||||
*/
|
||||
@Autowired(required = false)
|
||||
private IUserAuthenticationService userAuthenticationService;
|
||||
|
||||
@Override
|
||||
public Object run() {
|
||||
log.info("ClientIdentityFilter.run");
|
||||
//判空
|
||||
if (userAuthenticationService == null) {
|
||||
throw new SystemRuntimeException("You need to implement the IUserAuthenticationService interface");
|
||||
}
|
||||
//获得accessToken
|
||||
String accessToken = this.getAccessToken();
|
||||
//校验token
|
||||
userAuthenticationService.verification(accessToken);
|
||||
//返回
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,11 @@ package org.itkk.udf.auth.filter.user;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.itkk.udf.auth.Constant;
|
||||
import org.itkk.udf.auth.IUserAuthenticationService;
|
||||
import org.itkk.udf.auth.UserType;
|
||||
import org.itkk.udf.auth.filter.AbstractBaseZuulFilter;
|
||||
import org.itkk.udf.core.exception.SystemRuntimeException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.cloud.netflix.zuul.filters.support.FilterConstants;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -16,9 +19,24 @@ import org.springframework.stereotype.Component;
|
||||
@ConditionalOnProperty(value = "org.itkk.auth.filter.user.identity.enabled", matchIfMissing = true)
|
||||
public class UserIdentityFilter extends AbstractBaseZuulFilter {
|
||||
|
||||
/**
|
||||
* userAuthenticationService
|
||||
*/
|
||||
@Autowired(required = false)
|
||||
private IUserAuthenticationService userAuthenticationService;
|
||||
|
||||
@Override
|
||||
public Object run() {
|
||||
log.info("UserIdentityFilter.run");
|
||||
//判空
|
||||
if (userAuthenticationService == null) {
|
||||
throw new SystemRuntimeException("You need to implement the IUserAuthenticationService interface");
|
||||
}
|
||||
//获得accessToken
|
||||
String accessToken = this.getAccessToken();
|
||||
//校验token
|
||||
userAuthenticationService.verification(accessToken);
|
||||
//返回
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user