Commit 37cb42d3 authored by yanzg's avatar yanzg

异常处理显示

parent be954aaf
...@@ -93,6 +93,28 @@ public class TokenHelper { ...@@ -93,6 +93,28 @@ public class TokenHelper {
return StringHelper.to(cls, value); return StringHelper.to(cls, value);
} }
/**
* 缓存数据
*
* @param token 标记
* @param data 数据时间
*/
public static TokenData write(String token, Object data) {
return write(token, StringHelper.EMPTY, 0, data);
}
/**
* 缓存数据
*
* @param token 标记
* @param expire 有效期
* @param data 数据时间
*/
public static TokenData write(String token, long expire, Object data) {
return write(token, StringHelper.EMPTY, expire, data);
}
/** /**
* 缓存数据 * 缓存数据
* *
...@@ -110,7 +132,9 @@ public class TokenHelper { ...@@ -110,7 +132,9 @@ public class TokenHelper {
} }
tokenData.setToken(token); tokenData.setToken(token);
tokenData.setDataPwd(dataPwd); tokenData.setDataPwd(dataPwd);
tokenData.setExpire(expire); if (expire > 0) {
tokenData.setExpire(expire);
}
if (tokenData.getData() == null) { if (tokenData.getData() == null) {
tokenData.setData(new MapRow()); tokenData.setData(new MapRow());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment