perf:TokenBean移除无用的属性
This commit is contained in:
@@ -32,11 +32,13 @@ public class DemoWebConfigurer implements TieshengWebConfigurer, TsLoginConfigur
|
|||||||
public TokenBean login(CorePlatformUnique platformUnique) {
|
public TokenBean login(CorePlatformUnique platformUnique) {
|
||||||
TokenBean tokenBean = null;
|
TokenBean tokenBean = null;
|
||||||
if (!StrUtil.isEmpty(platformUnique.getUserId())) {
|
if (!StrUtil.isEmpty(platformUnique.getUserId())) {
|
||||||
tokenBean = new TokenBean(platformUnique.getUserId(), "", globalConfig.getService());
|
tokenBean = new TokenBean(platformUnique.getUserId(), "super");
|
||||||
} else if (Objects.equals(platformUnique.getUniqueId(), "1110290049")) {
|
} else if (Objects.equals(platformUnique.getUniqueId(), "1110290049")) {
|
||||||
tokenBean = new TokenBean("1", "", globalConfig.getService());
|
tokenBean = new TokenBean("1", "super");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tokenBean != null) {
|
||||||
tokenBean.setExtra("1110290049");
|
tokenBean.setExtra("1110290049");
|
||||||
tokenBean.setRoleId("super");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return tokenBean;
|
return tokenBean;
|
||||||
|
|||||||
@@ -12,19 +12,15 @@ import com.tiesheng.util.config.TsTokenConfig;
|
|||||||
public class TokenBean {
|
public class TokenBean {
|
||||||
|
|
||||||
private String id;
|
private String id;
|
||||||
private String environmentType;
|
|
||||||
private String service;
|
|
||||||
private String roleId;
|
private String roleId;
|
||||||
private String extra;
|
private String extra;
|
||||||
|
|
||||||
public TokenBean() {
|
public TokenBean() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public TokenBean(String id, String environmentType, String service) {
|
public TokenBean(String id, String roleId) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.environmentType = environmentType;
|
this.roleId = roleId;
|
||||||
this.service = service;
|
|
||||||
this.roleId = "";
|
|
||||||
this.extra = "";
|
this.extra = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,8 +33,6 @@ public class TokenBean {
|
|||||||
return JWT.create()
|
return JWT.create()
|
||||||
.setExpiresAt(DateUtil.offsetHour(DateUtil.date(), tsTokenConfig.getExpireHours()))
|
.setExpiresAt(DateUtil.offsetHour(DateUtil.date(), tsTokenConfig.getExpireHours()))
|
||||||
.setPayload("id", getId())
|
.setPayload("id", getId())
|
||||||
.setPayload("environmentType", StrUtil.emptyToDefault(getEnvironmentType(), ""))
|
|
||||||
.setPayload("service", StrUtil.emptyToDefault(getService(), ""))
|
|
||||||
.setPayload("roleId", StrUtil.emptyToDefault(getRoleId(), ""))
|
.setPayload("roleId", StrUtil.emptyToDefault(getRoleId(), ""))
|
||||||
.setPayload("extra", StrUtil.emptyToDefault(getExtra(), ""))
|
.setPayload("extra", StrUtil.emptyToDefault(getExtra(), ""))
|
||||||
.setKey(tsTokenConfig.getEncryptKey().getBytes())
|
.setKey(tsTokenConfig.getEncryptKey().getBytes())
|
||||||
@@ -57,22 +51,6 @@ public class TokenBean {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getEnvironmentType() {
|
|
||||||
return environmentType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnvironmentType(String environmentType) {
|
|
||||||
this.environmentType = environmentType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getService() {
|
|
||||||
return service;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setService(String service) {
|
|
||||||
this.service = service;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getExtra() {
|
public String getExtra() {
|
||||||
return extra;
|
return extra;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user