| | |
| | | if (child == null){ |
| | | child = false; |
| | | } |
| | | var param = (child?parent.window:window).location.href.split("?")[1]; |
| | | if (null != param) { |
| | | var resourceId = param.split("=")[1]; |
| | | var targetWindow = child ? parent.window : window; |
| | | var search = targetWindow.location.search || ""; |
| | | var resourceId = null; |
| | | |
| | | if (search) { |
| | | if (typeof URLSearchParams !== "undefined") { |
| | | resourceId = new URLSearchParams(search).get("resourceId"); |
| | | } |
| | | if (resourceId == null || resourceId === "") { |
| | | var match = search.replace(/^\?/, "").match(/(?:^|&)resourceId=([^&]*)/i); |
| | | resourceId = match ? decodeURIComponent(match[1]) : null; |
| | | } |
| | | } |
| | | |
| | | if (resourceId != null && resourceId !== "") { |
| | | $.ajax({ |
| | | url: baseUrl+"/power/menu/"+resourceId+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |