@Component public class RequestPool extends Object implements org.springframework.context.ApplicationContextAware
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
ENABLE_AS_LAST_URI_PREFIX
加解密标识(请求的最后一级路径前缀)
|
static boolean |
ENABLE_AUTH
是否开启对参数进行加解密
|
static String |
ENABLE_LOGINURL |
static Integer |
ERRORCODE |
static Integer |
SUCCESSCODE |
static String |
TOKEN_NAME
请求头中的token对应的key名称
|
static String |
URI_PREFIX
项目约定好的统一请求前缀
|
static ThreadLocal<Boolean> |
useResponse
是否使用项目统一包装返回,默认如果是项目约定的前缀则统一包装
|
| 构造器和说明 |
|---|
RequestPool() |
| 限定符和类型 | 方法和说明 |
|---|---|
static javax.servlet.http.HttpServletRequest |
get()
获取缓存
|
static String |
getAESKey()
获取用户的aes加密串
|
static String |
getCacheAttribute(String flag)
获取缓存到session信息
|
static String |
getSmsCode(String phone)
获取短信验证码
|
static String |
getToken()
获取用户授权的token值,用于解密请求数据
|
static Long |
getUserId()
获取用户id
|
static Long |
getUserIdNotException()
获取用户id(非异常)
|
static void |
refranshToken() |
static void |
removeCacheAttribute(String flag)
删除缓存到session信息
|
static void |
removeSmsCode(String phone) |
static void |
removeToken() |
static void |
setAESKey(String aesVal)
设置用户的aes加密串
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
static void |
setCacheAttribute(String flag,
Object val)
缓存到session信息
|
static void |
setSmsCode(String phone,
String code)
缓存短信验证码
|
static void |
setToken(String token)
为用户签发token
|
static void |
setUserId(Long userId) |
public static String ENABLE_LOGINURL
public static boolean ENABLE_AUTH
public static String ENABLE_AS_LAST_URI_PREFIX
public static String URI_PREFIX
public static String TOKEN_NAME
public static Integer SUCCESSCODE
public static Integer ERRORCODE
public static ThreadLocal<Boolean> useResponse
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext 在接口中 org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic static javax.servlet.http.HttpServletRequest get()
public static void removeSmsCode(String phone)
public static void setToken(String token)
public static void setUserId(Long userId)
public static void refranshToken()
public static String getToken()
public static void removeToken()
public static Long getUserId()
public static Long getUserIdNotException()
public static void setAESKey(String aesVal)
aesVal - public static String getAESKey()
public static void setCacheAttribute(String flag, Object val)
flag - 缓存keyval - 缓存数据public static String getCacheAttribute(String flag)
flag - 缓存keypublic static void removeCacheAttribute(String flag)
flag - 缓存keyCopyright © 2021. All rights reserved.