ming_node 2.2.6 → 2.2.7
Sign up to get free protection for your applications and to get access to all the features.
package/index.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
* By : Minglie
|
4
4
|
* QQ: 934031452
|
5
5
|
* Date :2021.12.01
|
6
|
-
* version :2.2.
|
6
|
+
* version :2.2.7
|
7
7
|
*/
|
8
8
|
var http = require('http');
|
9
9
|
var https = require('https');
|
@@ -42,6 +42,10 @@
|
|
42
42
|
M._globle_cacheMap = {}
|
43
43
|
//全局对象缓存
|
44
44
|
M._globle_lib_cacheMap={}
|
45
|
+
//全局插件地址缓存
|
46
|
+
M._globle_plugin_url_cacheMap={};
|
47
|
+
//全局插件
|
48
|
+
M._globle_plugin=new Set();
|
45
49
|
M._node_lib_path=process.env.NODE_PATH;
|
46
50
|
//远程静态资源路径
|
47
51
|
M.remoteStaticPath = "https://minglie.gitee.io/mingpage/static";
|
@@ -1732,6 +1736,7 @@ M.urlParse = function (url) {
|
|
1732
1736
|
} else {
|
1733
1737
|
plugin.install(app, args);
|
1734
1738
|
}
|
1739
|
+
M._globle_plugin.add(plugin);
|
1735
1740
|
plugin.installed = true;
|
1736
1741
|
}else {
|
1737
1742
|
if (Array.isArray(url)) {
|
@@ -1746,6 +1751,17 @@ M.urlParse = function (url) {
|
|
1746
1751
|
}
|
1747
1752
|
return app;
|
1748
1753
|
}
|
1754
|
+
|
1755
|
+
app.installPlugin=async function (pluginUrl,constructorParams,pluginParams){
|
1756
|
+
if(M._globle_plugin_url_cacheMap[pluginUrl]){
|
1757
|
+
return
|
1758
|
+
}
|
1759
|
+
M._globle_plugin_url_cacheMap[pluginUrl]=pluginUrl;
|
1760
|
+
const Plugin= await M.require(pluginUrl);
|
1761
|
+
const plugin= new Plugin(constructorParams);
|
1762
|
+
app.use(plugin,pluginParams)
|
1763
|
+
}
|
1764
|
+
|
1749
1765
|
/**
|
1750
1766
|
* 注册get请求
|
1751
1767
|
*/
|
package/package.json
CHANGED