k94314517
2023-09-05 fa2f172812de8344fa22c4ef088ea2a67257a0d3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package doumeemes.config.shiroMemory;
 
import doumeemes.core.exception.UnSafeSessionException;
 
import java.util.UUID;
 
/**
 * 默认Token管理器
 * @author Eva.Caesar Liu
 * @date 2022/04/18 18:12
 */
//@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();
        }
    }
}