首页 > 解决方案 > 如何动态获取项目区域的uuid

问题描述

我正在使用 window.parent.location.href ,通过它我可以实现当前页面(https://stackoverflow.com/questions/ask)完整的 url,但我的目的是获取该页面的 uuid 存在于其他网址,即(https://stackoverflow.com/questions/ask/id=_abcdes123

var parentLink = (window.parent.location.href).toString();
if (parentLink.includes("play")) {

projectAreaContextId = '_FpM0wL8DEeOhU53HggnQSg';  //uuid for play
} else if(parentLink.includes("complay")) {
    projectAreaContextId = '_t44MZaySEeSZm-Ey-wkoZw';   //uuid for complay
}

如果您看到我上面的代码,我正在尝试动态获取当前页面 url,但 projectareacontextid 是硬编码的,我也想动态获取,但是正如我提到的,项目区域的 uuid 不存在于当前页面 url 中,而是在下一页url,有什么办法可以实现吗,还有其他的api来获取项目区域的uuid吗?

标签: javascriptrational-team-concert

解决方案


推荐阅读