From ce0cabc072420dc6dc6c3f8957ec73455a8fd04b Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期六, 07 三月 2026 13:16:26 +0800
Subject: [PATCH] #

---
 src/main/webapp/static/js/common.js |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/main/webapp/static/js/common.js b/src/main/webapp/static/js/common.js
index 1b9840b..e361ccd 100644
--- a/src/main/webapp/static/js/common.js
+++ b/src/main/webapp/static/js/common.js
@@ -68,9 +68,21 @@
     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')},

--
Gitblit v1.9.1