diff --git a/udf-starter-auth/src/main/java/org/itkk/udf/auth/AuthProperties.java b/udf-starter-auth/src/main/java/org/itkk/udf/auth/AuthProperties.java index 8b6d2e2..23cf7e1 100644 --- a/udf-starter-auth/src/main/java/org/itkk/udf/auth/AuthProperties.java +++ b/udf-starter-auth/src/main/java/org/itkk/udf/auth/AuthProperties.java @@ -16,11 +16,6 @@ import java.util.Map; @ConfigurationProperties(prefix = "org.itkk.auth.properties") public class AuthProperties { - /** - * 是否单例登录 - */ - private boolean singletonLogin = false; - /** * 用户服务排除 */ diff --git a/udf-starter-auth/src/main/java/org/itkk/udf/auth/IUserAuthenticationService.java b/udf-starter-auth/src/main/java/org/itkk/udf/auth/IUserAuthenticationService.java index 01c345f..72fb7a2 100644 --- a/udf-starter-auth/src/main/java/org/itkk/udf/auth/IUserAuthenticationService.java +++ b/udf-starter-auth/src/main/java/org/itkk/udf/auth/IUserAuthenticationService.java @@ -7,6 +7,12 @@ public interface IUserAuthenticationService { /** * 用户鉴权 + *
+ * 需要处理单例登录的情况 + *
+ *+ * 在单例登录的情况下,需要处理强制登录的情况 + *
* * @param model 用户鉴权输入模型 * @return 用户鉴权响应模型 diff --git a/udf-starter-auth/src/main/java/org/itkk/udf/auth/component/DefUserAuthenticationService.java b/udf-starter-auth/src/main/java/org/itkk/udf/auth/component/DefUserAuthenticationService.java index e38ef05..e3fe27c 100644 --- a/udf-starter-auth/src/main/java/org/itkk/udf/auth/component/DefUserAuthenticationService.java +++ b/udf-starter-auth/src/main/java/org/itkk/udf/auth/component/DefUserAuthenticationService.java @@ -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; } } diff --git a/udf-starter-auth/src/main/java/org/itkk/udf/auth/domain/UserAuthenticationModel.java b/udf-starter-auth/src/main/java/org/itkk/udf/auth/domain/UserAuthenticationModel.java index 8e25fff..2fce72b 100644 --- a/udf-starter-auth/src/main/java/org/itkk/udf/auth/domain/UserAuthenticationModel.java +++ b/udf-starter-auth/src/main/java/org/itkk/udf/auth/domain/UserAuthenticationModel.java @@ -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; + /** * 强制登录(只在禁止同时登录的模式下有效) */ diff --git a/udf-starter-auth/src/main/java/org/itkk/udf/auth/filter/AbstractBaseZuulFilter.java b/udf-starter-auth/src/main/java/org/itkk/udf/auth/filter/AbstractBaseZuulFilter.java index f6a2f8d..6ebbd41 100644 --- a/udf-starter-auth/src/main/java/org/itkk/udf/auth/filter/AbstractBaseZuulFilter.java +++ b/udf-starter-auth/src/main/java/org/itkk/udf/auth/filter/AbstractBaseZuulFilter.java @@ -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