jiangping
2023-09-27 54a32ffec350618ddb98fd430a9eecc2f395f958
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.doumee.config.shiro;
 
import com.doumee.core.exception.UnSafeSessionException;
import org.springframework.stereotype.Component;
 
import java.util.UUID;
 
/**
 * 默认Token管理器
 * @author Eva.Caesar Liu
 * @date 2023/04/17 12:11
 */
@Component
public class ShiroTokenManager {
 
    String build() {
        return UUID.randomUUID().toString();
    }
 
    void check(String token) throws UnSafeSessionException {
        if (token == null || token.length() != 36) {
            throw new UnSafeSessionException();
        }
    }
}