mm_os 2.8.7 → 2.8.9
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/core/base/index.js +28 -28
- package/core/base/mqtt/index.js +314 -314
- package/core/base/mqtt/lib.js +39 -39
- package/core/base/web/index.js +109 -109
- package/core/com/mqtt/index.js +2 -6
- package/core/com/nav/tpl/admin_pc/page_channel.vue +137 -131
- package/core/com/nav/tpl/admin_pc/page_config.vue +280 -279
- package/core/com/nav/tpl/admin_pc/page_config_form.vue +194 -194
- package/core/com/nav/tpl/admin_pc/page_default.vue +47 -87
- package/core/com/nav/tpl/admin_pc/page_form.vue +19 -19
- package/core/com/nav/tpl/admin_pc/page_lang.vue +44 -45
- package/core/com/nav/tpl/admin_pc/page_nav.vue +140 -132
- package/core/com/nav/tpl/admin_pc/page_table.vue +135 -124
- package/core/com/nav/tpl/admin_pc/page_type.vue +139 -131
- package/core/com/nav/tpl/admin_pc/page_view.vue +124 -0
- package/core/com/nav/tpl/dev_pc/page_channel.vue +34 -34
- package/core/com/nav/tpl/dev_pc/page_config.vue +26 -26
- package/core/com/nav/tpl/dev_pc/page_default.vue +4 -4
- package/core/com/nav/tpl/dev_pc/page_form.vue +2 -2
- package/core/com/nav/tpl/dev_pc/page_nav.vue +34 -34
- package/core/com/nav/tpl/dev_pc/page_table.vue +34 -34
- package/core/com/nav/tpl/dev_pc/page_type.vue +131 -71
- package/core/com/nav/tpl/home_pc/page_default.vue +2 -2
- package/core/com/nav/tpl/home_pc/page_form.vue +2 -2
- package/core/com/nav/tpl/home_pc/page_view.vue +2 -2
- package/core/com/nav/tpl/home_phone/page_form.vue +2 -2
- package/core/com/nav/tpl/home_phone/page_list.vue +2 -2
- package/core/com/nav/tpl/home_phone/page_view.vue +2 -2
- package/demo/index.js +28 -0
- package/middleware/cors/index.js +84 -84
- package/middleware/cors/middleware.json +6 -6
- package/middleware/log/index.js +20 -20
- package/middleware/log/middleware.json +8 -8
- package/middleware/mqtt_base/index.js +10 -10
- package/middleware/mqtt_base/middleware.json +7 -7
- package/middleware/waf/index.js +64 -64
- package/middleware/waf/middleware.json +8 -8
- package/middleware/waf_ip/index.js +115 -115
- package/middleware/waf_ip/middleware.json +9 -9
- package/middleware/web_base/index.js +65 -65
- package/middleware/web_base/middleware.json +8 -8
- package/middleware/web_event/index.js +412 -412
- package/middleware/web_event/middleware.json +9 -9
- package/middleware/web_proxy/index.js +23 -23
- package/middleware/web_proxy/middleware.json +8 -8
- package/middleware/web_router/index.js +33 -33
- package/middleware/web_router/middleware.json +9 -9
- package/middleware/web_socket/index.js +21 -21
- package/middleware/web_socket/middleware.json +8 -8
- package/middleware/web_static/index.js +25 -25
- package/middleware/web_static/middleware.json +8 -8
- package/package.json +8 -8
- package/static/file/image/user/42/2025_01_02_10_58_15.png +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "web_event",
|
|
3
|
-
"title": "web路由事件",
|
|
4
|
-
"description": "用于拓展事件API",
|
|
5
|
-
"version": "1.0",
|
|
6
|
-
"type": "web",
|
|
7
|
-
"process_type": "common_before",
|
|
8
|
-
"after": true,
|
|
9
|
-
"sort": 15
|
|
1
|
+
{
|
|
2
|
+
"name": "web_event",
|
|
3
|
+
"title": "web路由事件",
|
|
4
|
+
"description": "用于拓展事件API",
|
|
5
|
+
"version": "1.0",
|
|
6
|
+
"type": "web",
|
|
7
|
+
"process_type": "common_before",
|
|
8
|
+
"after": true,
|
|
9
|
+
"sort": 15
|
|
10
10
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
const {
|
|
2
|
-
proxy,
|
|
3
|
-
proxyTo,
|
|
4
|
-
isMatch
|
|
5
|
-
} = require('mm_koa_proxy');
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* 应用
|
|
9
|
-
* @param {Object} server 服务
|
|
10
|
-
* @param {Object} config 配置参数
|
|
11
|
-
*/
|
|
12
|
-
module.exports = function(server, config) {
|
|
13
|
-
if (config && config.proxy) {
|
|
14
|
-
var options = config.proxy;
|
|
15
|
-
if (options.targets) {
|
|
16
|
-
server.use(proxy(options, function(op, ctx, next) {
|
|
17
|
-
if (ctx.session && ctx.session.user) {
|
|
18
|
-
ctx.request.header['user_id'] = ctx.session.user.user_id;
|
|
19
|
-
}
|
|
20
|
-
}));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return server;
|
|
1
|
+
const {
|
|
2
|
+
proxy,
|
|
3
|
+
proxyTo,
|
|
4
|
+
isMatch
|
|
5
|
+
} = require('mm_koa_proxy');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 应用
|
|
9
|
+
* @param {Object} server 服务
|
|
10
|
+
* @param {Object} config 配置参数
|
|
11
|
+
*/
|
|
12
|
+
module.exports = function(server, config) {
|
|
13
|
+
if (config && config.proxy) {
|
|
14
|
+
var options = config.proxy;
|
|
15
|
+
if (options.targets) {
|
|
16
|
+
server.use(proxy(options, function(op, ctx, next) {
|
|
17
|
+
if (ctx.session && ctx.session.user) {
|
|
18
|
+
ctx.request.header['user_id'] = ctx.session.user.user_id;
|
|
19
|
+
}
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return server;
|
|
24
24
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "web_proxy",
|
|
3
|
-
"title": "web代理服务",
|
|
4
|
-
"description": "用于将特定路由转发到别的服务端上做处理",
|
|
5
|
-
"version": "1.0",
|
|
6
|
-
"type": "web",
|
|
7
|
-
"process_type": "worker",
|
|
8
|
-
"sort": 6
|
|
1
|
+
{
|
|
2
|
+
"name": "web_proxy",
|
|
3
|
+
"title": "web代理服务",
|
|
4
|
+
"description": "用于将特定路由转发到别的服务端上做处理",
|
|
5
|
+
"version": "1.0",
|
|
6
|
+
"type": "web",
|
|
7
|
+
"process_type": "worker",
|
|
8
|
+
"sort": 6
|
|
9
9
|
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 应用
|
|
3
|
-
* @param {Object} server 服务
|
|
4
|
-
* @param {Object} config 配置参数
|
|
5
|
-
*/
|
|
6
|
-
module.exports = function(server, config) {
|
|
7
|
-
"./app".fullname().addDir();
|
|
8
|
-
|
|
9
|
-
// 追加主程序
|
|
10
|
-
server.main("/*", async (ctx, db) => {
|
|
11
|
-
var md = ctx.method.toLocaleLowerCase();
|
|
12
|
-
var list = server.routes[md];
|
|
13
|
-
return await server.run_route(ctx, db, list);
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
// 使用路由(主要)
|
|
17
|
-
server.use(async (ctx, next) => {
|
|
18
|
-
var db = ctx.db;
|
|
19
|
-
if (ctx.path !== "/favicon.ico") {
|
|
20
|
-
db.ret = await server.run_event(ctx, server.events.check, db);
|
|
21
|
-
if (!db.ret) {
|
|
22
|
-
db.ret = await server.run_event(ctx, server.events.main, db);
|
|
23
|
-
}
|
|
24
|
-
db.ret = await server.run_event(ctx, server.events.render, db) || db.ret;
|
|
25
|
-
if (db.ret) {
|
|
26
|
-
ctx.body = db.ret;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
await next();
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
return server;
|
|
33
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* 应用
|
|
3
|
+
* @param {Object} server 服务
|
|
4
|
+
* @param {Object} config 配置参数
|
|
5
|
+
*/
|
|
6
|
+
module.exports = function(server, config) {
|
|
7
|
+
"./app".fullname().addDir();
|
|
8
|
+
|
|
9
|
+
// 追加主程序
|
|
10
|
+
server.main("/*", async (ctx, db) => {
|
|
11
|
+
var md = ctx.method.toLocaleLowerCase();
|
|
12
|
+
var list = server.routes[md];
|
|
13
|
+
return await server.run_route(ctx, db, list);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// 使用路由(主要)
|
|
17
|
+
server.use(async (ctx, next) => {
|
|
18
|
+
var db = ctx.db;
|
|
19
|
+
if (ctx.path !== "/favicon.ico") {
|
|
20
|
+
db.ret = await server.run_event(ctx, server.events.check, db);
|
|
21
|
+
if (!db.ret) {
|
|
22
|
+
db.ret = await server.run_event(ctx, server.events.main, db);
|
|
23
|
+
}
|
|
24
|
+
db.ret = await server.run_event(ctx, server.events.render, db) || db.ret;
|
|
25
|
+
if (db.ret) {
|
|
26
|
+
ctx.body = db.ret;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
await next();
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
return server;
|
|
33
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "web_router",
|
|
3
|
-
"title": "web路由拓展",
|
|
4
|
-
"description": "用于拓展web路由的基本功能和事件API",
|
|
5
|
-
"version": "1.0",
|
|
6
|
-
"type": "web",
|
|
7
|
-
"process_type": "common_after",
|
|
8
|
-
"after": true,
|
|
9
|
-
"sort": 21
|
|
1
|
+
{
|
|
2
|
+
"name": "web_router",
|
|
3
|
+
"title": "web路由拓展",
|
|
4
|
+
"description": "用于拓展web路由的基本功能和事件API",
|
|
5
|
+
"version": "1.0",
|
|
6
|
+
"type": "web",
|
|
7
|
+
"process_type": "common_after",
|
|
8
|
+
"after": true,
|
|
9
|
+
"sort": 21
|
|
10
10
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
const websocket = require('koa-websocket');
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 应用
|
|
5
|
-
* @param {Object} server 服务
|
|
6
|
-
*/
|
|
7
|
-
module.exports = function(server, config) {
|
|
8
|
-
// 引入web socket通讯
|
|
9
|
-
server = websocket(server);
|
|
10
|
-
if (config.socket && $.Socket) {
|
|
11
|
-
// console.log("已启动websocket服务!");
|
|
12
|
-
//使用 websocket 服务
|
|
13
|
-
$.socket = new $.Socket();
|
|
14
|
-
$.socket.update();
|
|
15
|
-
server.ws.use((ctx, next) => {
|
|
16
|
-
$.socket.run(ctx, next);
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return server;
|
|
21
|
-
};
|
|
1
|
+
const websocket = require('koa-websocket');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 应用
|
|
5
|
+
* @param {Object} server 服务
|
|
6
|
+
*/
|
|
7
|
+
module.exports = function(server, config) {
|
|
8
|
+
// 引入web socket通讯
|
|
9
|
+
server = websocket(server);
|
|
10
|
+
if (config.socket && $.Socket) {
|
|
11
|
+
// console.log("已启动websocket服务!");
|
|
12
|
+
//使用 websocket 服务
|
|
13
|
+
$.socket = new $.Socket();
|
|
14
|
+
$.socket.update();
|
|
15
|
+
server.ws.use((ctx, next) => {
|
|
16
|
+
$.socket.run(ctx, next);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return server;
|
|
21
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "web_scoket",
|
|
3
|
-
"title": "webscoket通讯",
|
|
4
|
-
"description": "用于即时通讯",
|
|
5
|
-
"version": "1.0",
|
|
6
|
-
"type": "web",
|
|
7
|
-
"process_type": "master",
|
|
8
|
-
"sort": 18
|
|
1
|
+
{
|
|
2
|
+
"name": "web_scoket",
|
|
3
|
+
"title": "webscoket通讯",
|
|
4
|
+
"description": "用于即时通讯",
|
|
5
|
+
"version": "1.0",
|
|
6
|
+
"type": "web",
|
|
7
|
+
"process_type": "master",
|
|
8
|
+
"sort": 18
|
|
9
9
|
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
const statics = require('mm_statics');
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 应用
|
|
5
|
-
* @param {Object} server 服务
|
|
6
|
-
* @param {Object} config 配置参数
|
|
7
|
-
*/
|
|
8
|
-
module.exports = function(server, config) {
|
|
9
|
-
// 处理静态文件
|
|
10
|
-
if (config.static) {
|
|
11
|
-
server.use(statics(
|
|
12
|
-
config.static_path.fullname(), {
|
|
13
|
-
maxAge: config.max_age || 0,
|
|
14
|
-
gzip: config.compress || false,
|
|
15
|
-
brotli: config.compress || false
|
|
16
|
-
}));
|
|
17
|
-
// 使用多路径静态文件处理器
|
|
18
|
-
if ($.Static) {
|
|
19
|
-
const Static = $.Static;
|
|
20
|
-
$.static = new Static();
|
|
21
|
-
$.static.update();
|
|
22
|
-
server.use($.static.run);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return server;
|
|
1
|
+
const statics = require('mm_statics');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 应用
|
|
5
|
+
* @param {Object} server 服务
|
|
6
|
+
* @param {Object} config 配置参数
|
|
7
|
+
*/
|
|
8
|
+
module.exports = function(server, config) {
|
|
9
|
+
// 处理静态文件
|
|
10
|
+
if (config.static) {
|
|
11
|
+
server.use(statics(
|
|
12
|
+
config.static_path.fullname(), {
|
|
13
|
+
maxAge: config.max_age || 0,
|
|
14
|
+
gzip: config.compress || false,
|
|
15
|
+
brotli: config.compress || false
|
|
16
|
+
}));
|
|
17
|
+
// 使用多路径静态文件处理器
|
|
18
|
+
if ($.Static) {
|
|
19
|
+
const Static = $.Static;
|
|
20
|
+
$.static = new Static();
|
|
21
|
+
$.static.update();
|
|
22
|
+
server.use($.static.run);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return server;
|
|
26
26
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "web_static",
|
|
3
|
-
"title": "web静态文件处理",
|
|
4
|
-
"description": "用于处理静态文件",
|
|
5
|
-
"version": "1.0",
|
|
6
|
-
"type": "web",
|
|
7
|
-
"process_type": "worker",
|
|
8
|
-
"sort": 18
|
|
1
|
+
{
|
|
2
|
+
"name": "web_static",
|
|
3
|
+
"title": "web静态文件处理",
|
|
4
|
+
"description": "用于处理静态文件",
|
|
5
|
+
"version": "1.0",
|
|
6
|
+
"type": "web",
|
|
7
|
+
"process_type": "worker",
|
|
8
|
+
"sort": 18
|
|
9
9
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mm_os",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.9",
|
|
4
4
|
"description": "这是超级美眉服务端框架,用于快速构建应用程序。",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,29 +31,29 @@
|
|
|
31
31
|
"license": "ISC",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"compressing": "^1.10.1",
|
|
34
|
-
"koa": "^2.
|
|
34
|
+
"koa": "^2.16.0",
|
|
35
35
|
"koa-body": "^6.0.1",
|
|
36
36
|
"koa-compress": "^5.1.1",
|
|
37
37
|
"koa-send": "^5.0.1",
|
|
38
38
|
"koa-websocket": "^7.0.0",
|
|
39
39
|
"mm_check": "^1.4.9",
|
|
40
|
-
"mm_excel": "^1.2.
|
|
41
|
-
"mm_expand": "^1.
|
|
40
|
+
"mm_excel": "^1.2.1",
|
|
41
|
+
"mm_expand": "^1.8.0",
|
|
42
42
|
"mm_html": "^1.1.6",
|
|
43
43
|
"mm_koa_proxy": "^1.0.0",
|
|
44
44
|
"mm_logs": "^1.1.7",
|
|
45
|
-
"mm_machine": "^1.9.
|
|
45
|
+
"mm_machine": "^1.9.1",
|
|
46
46
|
"mm_mongodb": "^1.4.2",
|
|
47
47
|
"mm_mqtt": "^1.0.6",
|
|
48
|
-
"mm_mysql": "^1.
|
|
48
|
+
"mm_mysql": "^1.9.0",
|
|
49
49
|
"mm_redis": "^1.4.2",
|
|
50
|
-
"mm_ret": "^1.
|
|
50
|
+
"mm_ret": "^1.4.0",
|
|
51
51
|
"mm_session": "^1.4.8",
|
|
52
52
|
"mm_statics": "^1.4.8",
|
|
53
53
|
"mm_tpl": "^2.4.2",
|
|
54
54
|
"mm_xml": "^1.1.6",
|
|
55
55
|
"mosca": "^2.8.3",
|
|
56
|
-
"mqtt": "^5.10.
|
|
56
|
+
"mqtt": "^5.10.4",
|
|
57
57
|
"publish": "^0.6.0"
|
|
58
58
|
}
|
|
59
59
|
}
|
|
Binary file
|