| | |
| | | package com.sandu.common.redis; |
| | | |
| | | import com.sandu.common.security.config.SecurityProperties; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | |
| | | /** |
| | | * @author chenjiantian |
| | | * @date 2021/7/20 12:00 |
| | |
| | | |
| | | @Override |
| | | public String getModelName() { |
| | | return "user"; |
| | | String onlineKey = SpringContextHolder.getBean(SecurityProperties.class).getOnlineKey(); |
| | | if (onlineKey == null) { |
| | | throw new IllegalArgumentException("请配置onlineKey"); |
| | | } |
| | | return onlineKey; |
| | | } |
| | | |
| | | public UserModel(int expireSeconds, String prefix) { |
| | |
| | | |
| | | public static UserModel User = new UserModel(60, "gl"); |
| | | |
| | | public static UserModel USER_TOKEN = new UserModel(60 * 60 * 24 * 7, "token"); |
| | | public static UserModel USER_INFO = new UserModel(60 * 60 * 24 * 7, "info"); |
| | | |
| | | |
| | | } |