## 关于satoken的提示
### 本系统采用两个session存放相关信息
1、其中tokenSession存放的是
提供公共模块使用，获取是Object可以直接强转此实体.
主要使用在 SecurityUtils类上，使用的key: userInfo
```java
@Data
public class CurrentUser implements Serializable {
    @JsonSerialize(using = ToStringSerializer.class)
    private String id;

    private String username;

    private Object user;

    private List<String> permissions = new ArrayList<>();
}
```
2、Session存放的是UserDto,提供业务模块使用使用的key: UserDto
```java
@Getter
@Setter
public class UserDto extends BaseDTO implements Serializable {
    @JsonSerialize(using = ToStringSerializer.class)
    private String id;

    private Set<RoleSmallDto> roles;

    private Set<JobSmallDto> jobs;

    private DeptSmallDto dept;

    private Long deptId;

    private String username;

    private String nickName;

    private String email;

    private String phone;

    private String gender;

    private String avatarName;

    private String avatarPath;

    private String extId;

    private String extuserId;


    @JsonIgnore
    private String password;

    private Boolean enabled;

    @JsonIgnore
    private Boolean isAdmin = false;

    private Date pwdResetTime;
}
```

### 加密规则
```
SaSecureUtil.md5BySalt("123456", "salt")
```

### 另一种拦截
```
registry.addInterceptor(new SaRouteInterceptor((request, response, handler) -> {
            System.out.println(SaHolder.getRequest().getRequestPath());
            // 登录验证 -- 排除多个路径
            SaRouter
                    // 获取所有的
                    .match("/**")
                    // 排除下不需要拦截的
                    .notMatch(securityProperties.getExcludes())
                    // 对未排除的路径进行检查
                    .check(() -> {
                        // 检查是否登录 是否有token
                        StpUtil.checkLogin();
                    });
        })).addPathPatterns("/**");
        registry.addInterceptor(new SaAnnotationInterceptor()).addPathPatterns("/**");
```