@xingtukeji/micro 1.1.26 → 1.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ const CONSTANT = {
|
|
|
17
17
|
DOM_ID_PREFIX: "xt-micro-ifr-",
|
|
18
18
|
URL_PARAM_PREFIX: "__XT_MICRO_",
|
|
19
19
|
MICRO_VERSION: "__XT_MICRO_VERSION"
|
|
20
|
-
}, version = "1.1.
|
|
20
|
+
}, version = "1.1.27";
|
|
21
21
|
var utils_exports = /* @__PURE__ */ __export({
|
|
22
22
|
ConsoleUtil: () => ConsoleUtil,
|
|
23
23
|
addOrReplaceUrlParam: () => addOrReplaceUrlParam,
|
|
@@ -63,7 +63,7 @@ function addOrReplaceUrlParam(g, B, V) {
|
|
|
63
63
|
}
|
|
64
64
|
const ipcSyncAppInfo = async (g) => new Promise((B) => {
|
|
65
65
|
window.addEventListener("message", (V) => {
|
|
66
|
-
ConsoleUtil.trace("child ipcSyncAppInfo receive message", V.data), V.data.cmd === "$xt/micro/info" && (V.data.data.mainMicroVersion !== "1.1.
|
|
66
|
+
ConsoleUtil.trace("child ipcSyncAppInfo receive message", V.data), V.data.cmd === "$xt/micro/info" && (V.data.data.mainMicroVersion !== "1.1.27" && ConsoleUtil.warn(`子应用版本与主应用版本不一致,${g}子应用版本:${version},主应用版本:${V.data.data.mainMicroVersion}`), B(V.data.data));
|
|
67
67
|
}), ConsoleUtil.trace("child ipcSyncAppInfo send message", g), window.parent.postMessage({
|
|
68
68
|
cmd: "$xt/micro/info",
|
|
69
69
|
data: g
|
|
@@ -149,9 +149,10 @@ var generateId = (g) => `${CONSTANT.DOM_ID_PREFIX}${g}`, generateURL = (g, B = !
|
|
|
149
149
|
}
|
|
150
150
|
let H = typeof g.params == "function" ? g.params() : V(g.params) ? g.params : {}, U = typeof g.token == "function" ? g.token() : V(g.token) ? g.token : "", W = new URL(g.url.indexOf("http") > -1 ? g.url : window.location.origin + g.url), G = getQueryParameter(CONSTANT.URL_PARAM_PREFIX + g.name);
|
|
151
151
|
if (!B && G) {
|
|
152
|
-
let B = getAbsolutePath(G,
|
|
152
|
+
let B = getAbsolutePath(G, W.origin, !0);
|
|
153
153
|
if (B) {
|
|
154
|
-
|
|
154
|
+
ConsoleUtil.log("获取绝对路径", B, g), console.log("123123123================>");
|
|
155
|
+
let V = new URL(B, W.origin);
|
|
155
156
|
V.searchParams.forEach((g, B) => {
|
|
156
157
|
W.searchParams.set(B, g);
|
|
157
158
|
}), W.hash = V.hash;
|
|
@@ -189,7 +190,7 @@ var generateId = (g) => `${CONSTANT.DOM_ID_PREFIX}${g}`, generateURL = (g, B = !
|
|
|
189
190
|
loading;
|
|
190
191
|
loadingTimer;
|
|
191
192
|
constructor(g) {
|
|
192
|
-
return this.app = g, this.dom = void 0, this.panel = void 0,
|
|
193
|
+
return this.app = g, this.dom = void 0, this.panel = void 0, this;
|
|
193
194
|
}
|
|
194
195
|
mount(g, B = !1) {
|
|
195
196
|
let V;
|
|
@@ -335,7 +336,7 @@ var syncAppInfo = async (g) => await ipcSyncAppInfo(g).then((g) => {
|
|
|
335
336
|
};
|
|
336
337
|
});
|
|
337
338
|
async function syncUrlToWindow(g) {
|
|
338
|
-
ConsoleUtil.trace("syncUrlToWindow", g, window[CONSTANT.MICRO_APP]), window[CONSTANT.MICRO_APP] || syncAppInfo(g);
|
|
339
|
+
console.log("syncUrlToWindow", g, window[CONSTANT.MICRO_APP], window.location.href.match(/__XT_MICRO_([^=]+)=/), getQueryParameter(CONSTANT.MICRO_NAME)), ConsoleUtil.trace("syncUrlToWindow", g, window[CONSTANT.MICRO_APP]), window[CONSTANT.MICRO_APP] || await syncAppInfo(g);
|
|
339
340
|
let { name: B, sync: V, mainLocation: H } = window[CONSTANT.MICRO_APP], U = window.location.pathname + window.location.search + window.location.hash;
|
|
340
341
|
ConsoleUtil.trace("curUrl", U), ConsoleUtil.trace("child", "「$xt/micro/sync」", "send", B, U), window.parent.postMessage({
|
|
341
342
|
cmd: "$xt/micro/sync",
|