perf;调整TsTokenConfig中的ignores

This commit is contained in:
曾文豪
2023-02-26 11:09:05 +08:00
parent 56b923f5db
commit d045534be6
4 changed files with 18 additions and 10 deletions

4
CHANGELOG.md Normal file
View File

@@ -0,0 +1,4 @@
### 0.7.3
> 增加TsTokenConfig增加新的属性**ignorePaths**用于通过路径忽略token
> 调整TsTokenConfig中的**ignores**属性调整为**testMap**

4
README.md Normal file
View File

@@ -0,0 +1,4 @@
## 杭州铁晟科技有限公司基础项目
更新日志可点击查看[changelog](./CHANGELOG.md ':include')

View File

@@ -16,7 +16,7 @@ platform:
tiesheng:
token:
ignores:
test-map:
"1111":
id: "1111"
global:

View File

@@ -23,7 +23,7 @@ import java.util.Map;
@ConfigurationProperties("tiesheng.token")
public class TsTokenConfig {
private Map<String, TokenBean> ignores = MapUtil.newHashMap();
private Map<String, TokenBean> testMap = MapUtil.newHashMap();
private String encryptKey = "%kIp9frQCu";
private Integer expireHours = 48;
private String[] ignorePaths;
@@ -57,11 +57,11 @@ public class TsTokenConfig {
* @param token
* @return
*/
public TokenBean isIgnored(String token) {
if (ignores == null) {
public TokenBean isTestToken(String token) {
if (testMap == null) {
return null;
}
return ignores.get(token);
return testMap.get(token);
}
@@ -83,7 +83,7 @@ public class TsTokenConfig {
* @return
*/
public TokenBean validToken(String token, boolean thrExp) {
TokenBean tokenBean = isIgnored(token);
TokenBean tokenBean = isTestToken(token);
if (tokenBean != null) {
return tokenBean;
}
@@ -116,12 +116,12 @@ public class TsTokenConfig {
// setter\getter
///////////////////////////////////////////////////////////////////////////
public Map<String, TokenBean> getIgnores() {
return ignores;
public Map<String, TokenBean> getTestMap() {
return testMap;
}
public void setIgnores(Map<String, TokenBean> ignores) {
this.ignores = ignores;
public void setTestMap(Map<String, TokenBean> testMap) {
this.testMap = testMap;
}
public String getEncryptKey() {