mirror of
https://gitee.com/wangkang/udf.git
synced 2026-10-31 14:34:00 +00:00
修改
This commit is contained in:
@@ -16,11 +16,6 @@ import java.util.Map;
|
||||
@ConfigurationProperties(prefix = "org.itkk.auth.properties")
|
||||
public class AuthProperties {
|
||||
|
||||
/**
|
||||
* 是否单例登录
|
||||
*/
|
||||
private boolean singletonLogin = false;
|
||||
|
||||
/**
|
||||
* 用户服务排除
|
||||
*/
|
||||
|
||||
@@ -7,6 +7,12 @@ public interface IUserAuthenticationService {
|
||||
|
||||
/**
|
||||
* 用户鉴权
|
||||
* <p>
|
||||
* 需要处理单例登录的情况
|
||||
* </p>
|
||||
* <p>
|
||||
* 在单例登录的情况下,需要处理强制登录的情况
|
||||
* </p>
|
||||
*
|
||||
* @param model 用户鉴权输入模型
|
||||
* @return 用户鉴权响应模型
|
||||
|
||||
+5
-1
@@ -5,12 +5,16 @@ import org.itkk.udf.auth.IUserAuthenticationService;
|
||||
import org.itkk.udf.auth.domain.UserAuthenticationModel;
|
||||
import org.itkk.udf.auth.domain.UserAuthenticationResult;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* DefUserAuthenticationService
|
||||
*/
|
||||
public class DefUserAuthenticationService implements IUserAuthenticationService {
|
||||
@Override
|
||||
public UserAuthenticationResult authentication(UserAuthenticationModel model) {
|
||||
return null;
|
||||
UserAuthenticationResult userAuthenticationResult = new UserAuthenticationResult();
|
||||
userAuthenticationResult.setAccessToken(UUID.randomUUID().toString());
|
||||
return userAuthenticationResult;
|
||||
}
|
||||
}
|
||||
|
||||
+7
-1
@@ -23,7 +23,7 @@ public class UserAuthenticationModel implements Serializable {
|
||||
*/
|
||||
@ApiModelProperty(value = "用户名", required = true, dataType = "string")
|
||||
@NotBlank
|
||||
private String userName;
|
||||
private String account;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
@@ -32,6 +32,12 @@ public class UserAuthenticationModel implements Serializable {
|
||||
@NotBlank
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 是否单例登录默认false(如果为true,则同一账号,只能同时一个人登录)
|
||||
*/
|
||||
@ApiModelProperty(value = "是否单例登录默认false(如果为true,则同一账号,只能同时一个人登录)", required = false, dataType = "boolean")
|
||||
private boolean singleton = false;
|
||||
|
||||
/**
|
||||
* 强制登录(只在禁止同时登录的模式下有效)
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.itkk.udf.core.exception.AuthException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -42,7 +43,7 @@ public abstract class AbstractBaseZuulFilter extends ZuulFilter {
|
||||
String url = request.getRequestURI();
|
||||
String method = request.getMethod();
|
||||
//获得排除列表
|
||||
Map<String, ExcludeServiceMeta> map = null;
|
||||
Map<String, ExcludeServiceMeta> map = new HashMap<>();
|
||||
if (targetUserType.equals(UserType.USER)) {
|
||||
map = authProperties.getUserExcludeService();
|
||||
} else if (targetUserType.equals(UserType.CLIENT)) {
|
||||
@@ -64,7 +65,8 @@ public abstract class AbstractBaseZuulFilter extends ZuulFilter {
|
||||
|
||||
/**
|
||||
* 判断用户类型
|
||||
*s
|
||||
* s
|
||||
*
|
||||
* @param targetUserType 目标用户类型
|
||||
* @return 是否匹配
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user