@xingtukeji/micro 1.2.1 → 1.2.2
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 +3 -3
- 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.2.
|
|
20
|
+
}, version = "1.2.2";
|
|
21
21
|
var utils_exports = /* @__PURE__ */ __export({
|
|
22
22
|
ConsoleUtil: () => ConsoleUtil,
|
|
23
23
|
addOrReplaceUrlParam: () => addOrReplaceUrlParam,
|
|
@@ -65,7 +65,7 @@ const ipcSyncAppInfo = async (s) => new Promise((I, L) => {
|
|
|
65
65
|
let R = window.setTimeout(() => {
|
|
66
66
|
window.removeEventListener("message", z), L(/* @__PURE__ */ Error(`micro app info timeout: ${s}`));
|
|
67
67
|
}, 1e4), z = (L) => {
|
|
68
|
-
ConsoleUtil.trace("child ipcSyncAppInfo receive message", L.data), L.source === window.parent && L.data?.cmd === "$xt/micro/info" && L.data?.data?.name === s && L.data?.data?.mainLocation?.origin === L.origin && (window.clearTimeout(R), window.removeEventListener("message", z), L.data.data.mainMicroVersion !== "1.2.
|
|
68
|
+
ConsoleUtil.trace("child ipcSyncAppInfo receive message", L.data), L.source === window.parent && L.data?.cmd === "$xt/micro/info" && L.data?.data?.name === s && L.data?.data?.mainLocation?.origin === L.origin && (window.clearTimeout(R), window.removeEventListener("message", z), L.data.data.mainMicroVersion !== "1.2.2" && ConsoleUtil.warn(`子应用版本与主应用版本不一致,${s}子应用版本:${version},主应用版本:${L.data.data.mainMicroVersion}`), I(L.data.data));
|
|
69
69
|
};
|
|
70
70
|
window.addEventListener("message", z), ConsoleUtil.trace("child ipcSyncAppInfo send message", s), window.parent.postMessage({
|
|
71
71
|
cmd: "$xt/micro/info",
|
|
@@ -333,7 +333,7 @@ var isAppMessage = (s, I) => {
|
|
|
333
333
|
const microInit = async (s = {}) => {
|
|
334
334
|
window[CONSTANT.MICRO_TYPE] = "child";
|
|
335
335
|
let I = getQueryParameter(CONSTANT.IS_MICRO), L = getQueryParameter(CONSTANT.MICRO_NAME), R = getQueryParameter(CONSTANT.MICRO_TOKEN);
|
|
336
|
-
if (s.authHandler && await s.authHandler(R), ConsoleUtil.trace("child microInit", I, L), I && (window[CONSTANT.IS_MICRO] = I === "true", L && await syncAppInfo(L)), window[CONSTANT.IS_MICRO]) {
|
|
336
|
+
if (R && s.authHandler && await s.authHandler(R), ConsoleUtil.trace("child microInit", I, L), I && (window[CONSTANT.IS_MICRO] = I === "true", L && await syncAppInfo(L)), window[CONSTANT.IS_MICRO]) {
|
|
337
337
|
function I(s) {
|
|
338
338
|
var I = document.styleSheets[0];
|
|
339
339
|
if (!I) {
|