|
|
|
@ -35,6 +35,8 @@ import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import static com.ibeetl.jlw.entity.LoginTodo.jsonToEntity;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ResourcesApplication Service
|
|
|
|
|
*/
|
|
|
|
@ -211,6 +213,7 @@ public class ResourcesApplicationService extends CoreBaseService<ResourcesApplic
|
|
|
|
|
CollectionUtil.emptyIfNull(list).forEach(item -> {
|
|
|
|
|
String applicationLink = item.getApplicationLink();
|
|
|
|
|
applicationLink = makeHaveKeyStr(applicationLink);
|
|
|
|
|
// 根据应用设置的Key生成单点登录的真实链接
|
|
|
|
|
String realUrl = applicationLink.concat(getKeyByCurrentUser(item.getLinkSecretKey()));
|
|
|
|
|
item.set("realUrl", realUrl);
|
|
|
|
|
});
|
|
|
|
@ -244,11 +247,16 @@ public class ResourcesApplicationService extends CoreBaseService<ResourcesApplic
|
|
|
|
|
* @Author: lx
|
|
|
|
|
* @Date: 2022/12/11 17:06
|
|
|
|
|
*/
|
|
|
|
|
public void decodeApplicationUrl(String linkSecretKey, String url) {
|
|
|
|
|
|
|
|
|
|
public LoginTodo decodeApplicationUrl(String linkSecretKey, String url) {
|
|
|
|
|
try {
|
|
|
|
|
JWTVerifier verifier = JWT.require(Algorithm.HMAC256(linkSecretKey)).build();
|
|
|
|
|
DecodedJWT jwt = verifier.verify(url);
|
|
|
|
|
System.out.println(jwt.getAudience().get(0));
|
|
|
|
|
String json = jwt.getAudience().get(0);
|
|
|
|
|
return jsonToEntity(json);
|
|
|
|
|
}catch(Exception e) {
|
|
|
|
|
System.err.println(e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|