mirror of
https://gitee.com/dromara/sa-token.git
synced 2026-02-27 16:50:24 +08:00
完善文档
This commit is contained in:
@@ -42,8 +42,8 @@ public class SaOAuth2Config implements Serializable {
|
||||
/** Client-Token 保存的时间(单位:秒) 默认两个小时 */
|
||||
public long clientTokenTimeout = 60 * 60 * 2;
|
||||
|
||||
/** Past-Client-Token 保存的时间(单位:秒) 默认为 null,代表取 clientTokenTimeout 值 */
|
||||
public Long pastClientTokenTimeout = null;
|
||||
/** Past-Client-Token 保存的时间(单位:秒) 默认为 -1,代表延续 Client-Token有效期 */
|
||||
public long pastClientTokenTimeout = -1;
|
||||
|
||||
|
||||
/**
|
||||
@@ -183,7 +183,7 @@ public class SaOAuth2Config implements Serializable {
|
||||
/**
|
||||
* @return pastClientTokenTimeout
|
||||
*/
|
||||
public Long getPastClientTokenTimeout() {
|
||||
public long getPastClientTokenTimeout() {
|
||||
return pastClientTokenTimeout;
|
||||
}
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ public class SaOAuth2Template {
|
||||
|
||||
// 2.5、如果配置了 PastClientToken 的 ttl ,则需要更新一下
|
||||
SaClientModel cm = checkClientModel(clientId);
|
||||
if(oldCt != null && cm.getPastClientTokenTimeout() != null) {
|
||||
if(oldCt != null && cm.getPastClientTokenTimeout() != -1) {
|
||||
oldCt.expiresTime = System.currentTimeMillis() + (cm.getPastClientTokenTimeout() * 1000);
|
||||
saveClientToken(oldCt);
|
||||
}
|
||||
@@ -607,7 +607,7 @@ public class SaOAuth2Template {
|
||||
}
|
||||
Long ttl = ct.getExpiresIn();
|
||||
SaClientModel cm = checkClientModel(ct.clientId);
|
||||
if (null != cm.getPastClientTokenTimeout()) {
|
||||
if (cm.getPastClientTokenTimeout() != -1) {
|
||||
ttl = cm.getPastClientTokenTimeout();
|
||||
}
|
||||
SaManager.getSaTokenDao().set(splicingPastTokenIndexKey(ct.clientId), ct.clientToken, ttl);
|
||||
|
||||
@@ -47,11 +47,11 @@ public class SaClientModel implements Serializable {
|
||||
public Boolean isClient = false;
|
||||
|
||||
/**
|
||||
* 是否自动判断开放的授权模式
|
||||
* 是否自动判断此 Client 开放的授权模式
|
||||
* <br> 此值为true时:四种模式(isCode、isImplicit、isPassword、isClient)是否生效,依靠全局设置
|
||||
* <br> 此值为false时:四种模式(isCode、isImplicit、isPassword、isClient)是否生效,依靠局部配置+全局配置
|
||||
*/
|
||||
public Boolean isAutoMode = false;
|
||||
public Boolean isAutoMode = true;
|
||||
|
||||
/** 单独配置此Client:是否在每次 Refresh-Token 刷新 Access-Token 时,产生一个新的 Refresh-Token [默认取全局配置] */
|
||||
public Boolean isNewRefresh;
|
||||
@@ -66,7 +66,7 @@ public class SaClientModel implements Serializable {
|
||||
public long clientTokenTimeout;
|
||||
|
||||
/** 单独配置此Client:Past-Client-Token 保存的时间(单位:秒) [默认取全局配置] */
|
||||
public Long pastClientTokenTimeout;
|
||||
public long pastClientTokenTimeout;
|
||||
|
||||
|
||||
public SaClientModel() {
|
||||
@@ -215,14 +215,14 @@ public class SaClientModel implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 是否自动判断开放的授权模式
|
||||
* @return 是否自动判断此 Client 开放的授权模式
|
||||
*/
|
||||
public Boolean getIsAutoMode() {
|
||||
return isAutoMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param isAutoMode 是否自动判断开放的授权模式
|
||||
* @param isAutoMode 是否自动判断此 Client 开放的授权模式
|
||||
* @return 对象自身
|
||||
*/
|
||||
public SaClientModel setIsAutoMode(Boolean isAutoMode) {
|
||||
@@ -298,7 +298,7 @@ public class SaClientModel implements Serializable {
|
||||
/**
|
||||
* @return 此Client:Past-Client-Token 保存的时间(单位:秒) [默认取全局配置]
|
||||
*/
|
||||
public Long getPastClientTokenTimeout() {
|
||||
public long getPastClientTokenTimeout() {
|
||||
return pastClientTokenTimeout;
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ public class SaClientModel implements Serializable {
|
||||
* @param pastClientTokenTimeout 单独配置此Client:Past-Client-Token 保存的时间(单位:秒) [默认取全局配置]
|
||||
* @return 对象自身
|
||||
*/
|
||||
public SaClientModel setPastClientTokenTimeout(Long pastClientTokenTimeout) {
|
||||
public SaClientModel setPastClientTokenTimeout(long pastClientTokenTimeout) {
|
||||
this.pastClientTokenTimeout = pastClientTokenTimeout;
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user