| @@ -1,5 +1,7 @@ | |||||
| package com.simple.domain.po; | package com.simple.domain.po; | ||||
| import com.simple.utils.BaseConstant; | |||||
| import javax.persistence.*; | import javax.persistence.*; | ||||
| import java.util.*; | import java.util.*; | ||||
| import java.math.*; | import java.math.*; | ||||
| @@ -11,9 +13,7 @@ import java.io.Serializable; | |||||
| @Table(name = "wx_c_user") | @Table(name = "wx_c_user") | ||||
| public class WxCUser implements Serializable { | public class WxCUser implements Serializable { | ||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| //12小时后过期 | |||||
| private final static int EXPIRE = 3600 * 12; | |||||
| @Id | @Id | ||||
| protected Long id; | protected Long id; | ||||
| @@ -348,7 +348,7 @@ public class WxCUser implements Serializable { | |||||
| //生成一个token | //生成一个token | ||||
| String token = UUID.randomUUID().toString(); | String token = UUID.randomUUID().toString(); | ||||
| //过期时间 | //过期时间 | ||||
| Date expireTime = new Date(currentDate.getTime() + EXPIRE * 1000); | |||||
| Date expireTime = new Date(currentDate.getTime() + BaseConstant.EXPIRE * 1000); | |||||
| setToken(token); | setToken(token); | ||||
| setExpireTime(expireTime); | setExpireTime(expireTime); | ||||
| } | } | ||||
| @@ -1,5 +1,7 @@ | |||||
| package com.simple.domain.po; | package com.simple.domain.po; | ||||
| import com.simple.utils.BaseConstant; | |||||
| import javax.persistence.*; | import javax.persistence.*; | ||||
| import java.util.*; | import java.util.*; | ||||
| import java.math.*; | import java.math.*; | ||||
| @@ -11,8 +13,6 @@ import java.io.Serializable; | |||||
| @Table(name = "wx_merchant_b_user") | @Table(name = "wx_merchant_b_user") | ||||
| public class WxMerchantBUser implements Serializable { | public class WxMerchantBUser implements Serializable { | ||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| //12小时后过期 | |||||
| private final static int EXPIRE = 3600 * 12; | |||||
| @Id | @Id | ||||
| protected Long id; | protected Long id; | ||||
| @@ -208,7 +208,7 @@ public class WxMerchantBUser implements Serializable { | |||||
| //生成一个token | //生成一个token | ||||
| String token = UUID.randomUUID().toString(); | String token = UUID.randomUUID().toString(); | ||||
| //过期时间 | //过期时间 | ||||
| Date expireTime = new Date(currentDate.getTime() + EXPIRE * 1000); | |||||
| Date expireTime = new Date(currentDate.getTime() + BaseConstant.EXPIRE * 1000); | |||||
| setToken(token); | setToken(token); | ||||
| setExpireTime(expireTime); | setExpireTime(expireTime); | ||||
| } | } | ||||
| @@ -0,0 +1,7 @@ | |||||
| package com.simple.utils; | |||||
| public class BaseConstant { | |||||
| //12小时后过期 | |||||
| public final static int EXPIRE = 3600 * 12; | |||||
| } | |||||