ls-pro-common 3.1.9 → 3.1.10
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/common.css +1 -0
- package/dist/common.js +1 -1
- package/dist/common.min.css +1 -0
- package/dist/common.min.js +1 -1
- package/es/utils/index.js +10 -4
- package/lib/utils/index.js +10 -4
- package/package.json +1 -1
package/es/utils/index.js
CHANGED
|
@@ -42,9 +42,10 @@ export var getResourceProps = function getResourceProps(name) {
|
|
|
42
42
|
obj = resList.find(function (o) {
|
|
43
43
|
return o.resourceId === id;
|
|
44
44
|
});
|
|
45
|
-
} else if (location.pathname && location.pathname.length >
|
|
45
|
+
} else if (location.pathname && location.pathname.length > 3) {
|
|
46
|
+
var url = location.pathname + location.hash;
|
|
46
47
|
obj = resList.find(function (o) {
|
|
47
|
-
return o.microUrl === location.pathname;
|
|
48
|
+
return o.microUrl && o.microUrl === location.pathname || o.url === url;
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
if (!obj) return '';
|
|
@@ -399,9 +400,14 @@ export var appPath = function appPath() {
|
|
|
399
400
|
return window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
|
|
400
401
|
}
|
|
401
402
|
if (path) return path;
|
|
403
|
+
//本地开发环境,判断是否hash路由,如果是hash路由,则返回./
|
|
404
|
+
if (isDev) {
|
|
405
|
+
return location.hash ? './' : '/';
|
|
406
|
+
}
|
|
407
|
+
// 生产环境,返回当前路径
|
|
402
408
|
var p = location.pathname || '';
|
|
403
|
-
|
|
404
|
-
return
|
|
409
|
+
if (p === '/') return location.origin + '/';
|
|
410
|
+
return location.origin + '/' + p.split('/')[1] + '/';
|
|
405
411
|
};
|
|
406
412
|
/**
|
|
407
413
|
* 深度复制对象
|
package/lib/utils/index.js
CHANGED
|
@@ -42,9 +42,10 @@ export var getResourceProps = function getResourceProps(name) {
|
|
|
42
42
|
obj = resList.find(function (o) {
|
|
43
43
|
return o.resourceId === id;
|
|
44
44
|
});
|
|
45
|
-
} else if (location.pathname && location.pathname.length >
|
|
45
|
+
} else if (location.pathname && location.pathname.length > 3) {
|
|
46
|
+
var url = location.pathname + location.hash;
|
|
46
47
|
obj = resList.find(function (o) {
|
|
47
|
-
return o.microUrl === location.pathname;
|
|
48
|
+
return o.microUrl && o.microUrl === location.pathname || o.url === url;
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
if (!obj) return '';
|
|
@@ -399,9 +400,14 @@ export var appPath = function appPath() {
|
|
|
399
400
|
return window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
|
|
400
401
|
}
|
|
401
402
|
if (path) return path;
|
|
403
|
+
//本地开发环境,判断是否hash路由,如果是hash路由,则返回./
|
|
404
|
+
if (isDev) {
|
|
405
|
+
return location.hash ? './' : '/';
|
|
406
|
+
}
|
|
407
|
+
// 生产环境,返回当前路径
|
|
402
408
|
var p = location.pathname || '';
|
|
403
|
-
|
|
404
|
-
return
|
|
409
|
+
if (p === '/') return location.origin + '/';
|
|
410
|
+
return location.origin + '/' + p.split('/')[1] + '/';
|
|
405
411
|
};
|
|
406
412
|
/**
|
|
407
413
|
* 深度复制对象
|