feat(auth): 添加CAS单点登录功能
- 配置开发和生产环境的CAS登录URL和登出URL - 新增CacheHelper缓存工具类用于缓存操作 - 创建LideeUserDto用户数据传输对象 - 在SecurityConfig中允许CAS登录和登出接口匿名访问 - 添加SysLoginController中的logincas和outlogcas接口 - 实现SysLoginService中的CAS登录验证和登出逻辑 - 集成HttpUtils进行CAS服务器通信验证 Signed-off-by: NewName <1048783178@qq.com>
This commit is contained in:
50
lidee-common/src/main/java/iot/lidee/common/core/cache/CacheHelper.java
vendored
Normal file
50
lidee-common/src/main/java/iot/lidee/common/core/cache/CacheHelper.java
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
package iot.lidee.common.core.cache;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Component
|
||||
public class CacheHelper {
|
||||
|
||||
/**
|
||||
* 获取指定key的String类型缓存
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
public String stringGet(String key) {
|
||||
return null;
|
||||
}
|
||||
Map<String,String> stringMultiGet(List<String> keys) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置指定key的String类型缓存
|
||||
* @param key
|
||||
* @param value 缓存值
|
||||
* @return
|
||||
*/
|
||||
public void stringSet(String key, String value) {
|
||||
|
||||
}
|
||||
/**
|
||||
* 设置指定key的String类型缓存,包含过期时间
|
||||
* @param key
|
||||
* @param value
|
||||
* @param seconds
|
||||
*/
|
||||
public void stringSetExpire(String key, String value, long seconds) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否存在指定KEY
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
public boolean exist(String key) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package iot.lidee.common.core.domain.model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class LideeUserDto {
|
||||
|
||||
/** 登录名*/
|
||||
@NotBlank
|
||||
private String loginName;
|
||||
|
||||
/** 密码*/
|
||||
@NotBlank
|
||||
private String password;
|
||||
|
||||
/** 真实用户 */
|
||||
private String realName;
|
||||
|
||||
/** 登录成功后的 */
|
||||
private String token;
|
||||
|
||||
/** 用户所拥有的权限合集 */
|
||||
private List<String> authorities;
|
||||
}
|
||||
Reference in New Issue
Block a user