@maiyunnet/kebab 2.0.0
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/.VSCodeCounter/2025-02-14_14-46-44/details.md +82 -0
- package/.VSCodeCounter/2025-02-14_14-46-44/diff-details.md +15 -0
- package/.VSCodeCounter/2025-02-14_14-46-44/diff.csv +2 -0
- package/.VSCodeCounter/2025-02-14_14-46-44/diff.md +19 -0
- package/.VSCodeCounter/2025-02-14_14-46-44/diff.txt +22 -0
- package/.VSCodeCounter/2025-02-14_14-46-44/results.csv +69 -0
- package/.VSCodeCounter/2025-02-14_14-46-44/results.json +1 -0
- package/.VSCodeCounter/2025-02-14_14-46-44/results.md +48 -0
- package/.VSCodeCounter/2025-02-14_14-46-44/results.txt +118 -0
- package/.vscode/tasks.json +15 -0
- package/LICENSE +201 -0
- package/README.md +201 -0
- package/bin/kebab.js +2 -0
- package/eslint.config.js +22 -0
- package/index.js +19 -0
- package/index.ts +33 -0
- package/lib/buffer.js +108 -0
- package/lib/buffer.ts +152 -0
- package/lib/captcha/zcool-addict-italic.ttf +0 -0
- package/lib/captcha.js +71 -0
- package/lib/captcha.ts +63 -0
- package/lib/consistent.js +171 -0
- package/lib/consistent.ts +219 -0
- package/lib/core.js +663 -0
- package/lib/core.ts +880 -0
- package/lib/crypto.js +256 -0
- package/lib/crypto.ts +384 -0
- package/lib/db.js +521 -0
- package/lib/db.ts +719 -0
- package/lib/dns.js +321 -0
- package/lib/dns.ts +405 -0
- package/lib/fs.js +405 -0
- package/lib/fs.ts +527 -0
- package/lib/jwt.js +223 -0
- package/lib/jwt.ts +276 -0
- package/lib/kv.js +1004 -0
- package/lib/kv.ts +1489 -0
- package/lib/lan.js +99 -0
- package/lib/lan.ts +87 -0
- package/lib/net/cacert.pem +3480 -0
- package/lib/net/formdata.js +137 -0
- package/lib/net/formdata.ts +166 -0
- package/lib/net/request.js +102 -0
- package/lib/net/request.ts +150 -0
- package/lib/net/response.js +28 -0
- package/lib/net/response.ts +59 -0
- package/lib/net.js +462 -0
- package/lib/net.ts +662 -0
- package/lib/s3.js +180 -0
- package/lib/s3.ts +235 -0
- package/lib/scan.js +276 -0
- package/lib/scan.ts +364 -0
- package/lib/session.js +177 -0
- package/lib/session.ts +230 -0
- package/lib/sql.js +818 -0
- package/lib/sql.ts +1151 -0
- package/lib/ssh/sftp.js +373 -0
- package/lib/ssh/sftp.ts +508 -0
- package/lib/ssh/shell.js +109 -0
- package/lib/ssh/shell.ts +123 -0
- package/lib/ssh.js +171 -0
- package/lib/ssh.ts +191 -0
- package/lib/text/tld.json +1 -0
- package/lib/text.js +452 -0
- package/lib/text.ts +607 -0
- package/lib/time.js +216 -0
- package/lib/time.ts +254 -0
- package/lib/ws.js +373 -0
- package/lib/ws.ts +523 -0
- package/lib/zip.js +381 -0
- package/lib/zip.ts +447 -0
- package/lib/zlib.js +289 -0
- package/lib/zlib.ts +350 -0
- package/main.js +51 -0
- package/main.ts +27 -0
- package/package.json +37 -0
- package/sys/child.js +585 -0
- package/sys/child.ts +678 -0
- package/sys/cmd.js +226 -0
- package/sys/cmd.ts +225 -0
- package/sys/ctr.js +608 -0
- package/sys/ctr.ts +904 -0
- package/sys/master.js +314 -0
- package/sys/master.ts +355 -0
- package/sys/mod.js +1273 -0
- package/sys/mod.ts +1871 -0
- package/sys/route.js +922 -0
- package/sys/route.ts +1113 -0
- package/types/index.d.ts +283 -0
- package/www/example/ctr/main.js +42 -0
- package/www/example/ctr/main.ts +9 -0
- package/www/example/ctr/middle.js +57 -0
- package/www/example/ctr/middle.ts +26 -0
- package/www/example/ctr/test.js +2818 -0
- package/www/example/ctr/test.ts +3218 -0
- package/www/example/data/locale/en.test.json +8 -0
- package/www/example/data/locale/index.html +1 -0
- package/www/example/data/locale/ja.test.json +8 -0
- package/www/example/data/locale/sc.test.json +8 -0
- package/www/example/data/locale/tc.test.json +8 -0
- package/www/example/data/test.zip +0 -0
- package/www/example/kebab.json +24 -0
- package/www/example/mod/test.js +49 -0
- package/www/example/mod/test.ts +47 -0
- package/www/example/mod/testdata.js +11 -0
- package/www/example/mod/testdata.ts +30 -0
- package/www/example/route.json +6 -0
- package/www/example/view/test.ejs +11 -0
- package/www/example/ws/mproxy.js +49 -0
- package/www/example/ws/mproxy.ts +16 -0
- package/www/example/ws/rproxy.js +47 -0
- package/www/example/ws/rproxy.ts +14 -0
- package/www/example/ws/test.js +68 -0
- package/www/example/ws/test.ts +36 -0
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project: Kebab, User: JianSuoQiYue
|
|
3
|
+
* Date: 2022-07-22 13:44:12
|
|
4
|
+
* Last: 2022-07-22 13:44:12, 2023-5-2 21:12:32, 2023-12-14 11:43:09
|
|
5
|
+
*/
|
|
6
|
+
import * as http from 'http';
|
|
7
|
+
|
|
8
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
9
|
+
|
|
10
|
+
/** --- 除非确定是不可知的 Json,否则不能使用 --- */
|
|
11
|
+
export type Json = any;
|
|
12
|
+
|
|
13
|
+
/* eslint-enable */
|
|
14
|
+
|
|
15
|
+
/** --- 数据库值的类型 --- */
|
|
16
|
+
export type DbValue = string | number | null | Record<string, Json>;
|
|
17
|
+
|
|
18
|
+
/** --- mod ls 对象 --- */
|
|
19
|
+
export declare class Rows<T> implements Iterable<T> {
|
|
20
|
+
|
|
21
|
+
/** --- 总行数 --- */
|
|
22
|
+
public get length(): number;
|
|
23
|
+
|
|
24
|
+
/** --- 通过索引获取一个对象 --- */
|
|
25
|
+
public item(index: number): T;
|
|
26
|
+
|
|
27
|
+
/** --- 转换为数组对象 --- */
|
|
28
|
+
public toArray(): Array<Record<string, DbValue>>;
|
|
29
|
+
|
|
30
|
+
public [Symbol.iterator](): Iterator<T>;
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** --- 虚拟机配置对象 --- */
|
|
35
|
+
export interface IVhost {
|
|
36
|
+
readonly 'name': string;
|
|
37
|
+
readonly 'domains': string[];
|
|
38
|
+
readonly 'root': string;
|
|
39
|
+
readonly 'remark': string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** --- 上传的文件信息对象 --- */
|
|
43
|
+
export interface IPostFile {
|
|
44
|
+
readonly 'name': string;
|
|
45
|
+
readonly 'origin': string;
|
|
46
|
+
readonly 'size': number;
|
|
47
|
+
readonly 'path': string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** --- 动态目录配置文件 --- */
|
|
51
|
+
export interface IConfig {
|
|
52
|
+
'set': {
|
|
53
|
+
'timezone': number;
|
|
54
|
+
'mustHttps': boolean;
|
|
55
|
+
'cacheTtl': number;
|
|
56
|
+
|
|
57
|
+
'staticVer': string;
|
|
58
|
+
'staticPath': string;
|
|
59
|
+
'staticPathFull': string;
|
|
60
|
+
|
|
61
|
+
[key: string]: Json;
|
|
62
|
+
};
|
|
63
|
+
'const': IConfigConst;
|
|
64
|
+
'db': IConfigDb;
|
|
65
|
+
'jwt': IConfigJwt;
|
|
66
|
+
'kv': IConfigKv;
|
|
67
|
+
'route': Record<string, string>;
|
|
68
|
+
'session': {
|
|
69
|
+
'name': string;
|
|
70
|
+
'ttl': number;
|
|
71
|
+
'ssl': boolean;
|
|
72
|
+
};
|
|
73
|
+
'sql': IConfigSql;
|
|
74
|
+
'dns': Record<string, IConfigDns>;
|
|
75
|
+
'lang': IConfigLang;
|
|
76
|
+
's3': Record<string, IConfigS3>;
|
|
77
|
+
'turnstile': IConfigTurnstile;
|
|
78
|
+
|
|
79
|
+
[key: string]: Record<string, Json>;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** --- 动配数据库 --- */
|
|
83
|
+
export interface IConfigLang {
|
|
84
|
+
'list': string[];
|
|
85
|
+
'direct': string[];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** --- 动配对象存储信息 --- */
|
|
89
|
+
export interface IConfigS3 {
|
|
90
|
+
/** --- cf r2 要用 --- */
|
|
91
|
+
'account'?: string;
|
|
92
|
+
'sid': string;
|
|
93
|
+
'skey': string;
|
|
94
|
+
'region': string;
|
|
95
|
+
'bucket': string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** --- 动配对象存储信息 --- */
|
|
99
|
+
export interface IConfigTurnstile {
|
|
100
|
+
'CF': {
|
|
101
|
+
'sid': string;
|
|
102
|
+
'skey': string;
|
|
103
|
+
},
|
|
104
|
+
'TENCENT': {
|
|
105
|
+
'sid': string;
|
|
106
|
+
'skey': string;
|
|
107
|
+
'aid': string;
|
|
108
|
+
'akey': string;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** --- 动配数据库 --- */
|
|
113
|
+
export interface IConfigDb {
|
|
114
|
+
'host': string;
|
|
115
|
+
'port': number;
|
|
116
|
+
'charset': string;
|
|
117
|
+
'name': string;
|
|
118
|
+
|
|
119
|
+
'user': string;
|
|
120
|
+
'pwd': string;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** --- Jwt 信息 --- */
|
|
124
|
+
export interface IConfigJwt {
|
|
125
|
+
'name': string;
|
|
126
|
+
'ttl': number;
|
|
127
|
+
'ssl': boolean;
|
|
128
|
+
'secret': string;
|
|
129
|
+
'auth': boolean;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** --- DNS --- */
|
|
133
|
+
export interface IConfigDns {
|
|
134
|
+
'sid': string;
|
|
135
|
+
'skey': string;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** --- 动配 kv --- */
|
|
139
|
+
export interface IConfigKv {
|
|
140
|
+
'host': string;
|
|
141
|
+
'port': number;
|
|
142
|
+
'index': number;
|
|
143
|
+
'pre': string;
|
|
144
|
+
|
|
145
|
+
'user': string;
|
|
146
|
+
'pwd': string;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** --- 动配 sql --- */
|
|
150
|
+
export interface IConfigSql {
|
|
151
|
+
'pre': string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** --- 动配常量 --- */
|
|
155
|
+
export interface IConfigConst {
|
|
156
|
+
'path': string;
|
|
157
|
+
'qs': string;
|
|
158
|
+
'startTime': bigint;
|
|
159
|
+
'startMemory': number;
|
|
160
|
+
|
|
161
|
+
// --- 环境判断 ---
|
|
162
|
+
|
|
163
|
+
'mobile': boolean;
|
|
164
|
+
'wechat': boolean;
|
|
165
|
+
'https': boolean;
|
|
166
|
+
'host': string;
|
|
167
|
+
'hostname': string;
|
|
168
|
+
'hostport': number;
|
|
169
|
+
'uri': IUrlParse;
|
|
170
|
+
|
|
171
|
+
// --- 服务端用的路径 ---
|
|
172
|
+
|
|
173
|
+
'rootPath': string;
|
|
174
|
+
'modPath': string;
|
|
175
|
+
'ctrPath': string;
|
|
176
|
+
'viewPath': string;
|
|
177
|
+
'dataPath': string;
|
|
178
|
+
'wsPath': string;
|
|
179
|
+
|
|
180
|
+
// --- 前端用的路径 ---
|
|
181
|
+
|
|
182
|
+
'urlBase': string;
|
|
183
|
+
'urlStc': string;
|
|
184
|
+
'urlFull': string;
|
|
185
|
+
'urlStcFull': string;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/** --- http headers --- */
|
|
189
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
190
|
+
export type THttpHeaders = http.IncomingHttpHeaders & {
|
|
191
|
+
'http-version'?: '1.1' | '2.0';
|
|
192
|
+
'http-code'?: number;
|
|
193
|
+
'http-url'?: string;
|
|
194
|
+
};
|
|
195
|
+
/* eslint-enable */
|
|
196
|
+
|
|
197
|
+
/** --- Net Cookie 对象 --- */
|
|
198
|
+
export interface ICookie {
|
|
199
|
+
'name': string;
|
|
200
|
+
'value': string;
|
|
201
|
+
/** --- 有效期秒级时间戳 --- */
|
|
202
|
+
'exp': number;
|
|
203
|
+
'path': string;
|
|
204
|
+
'domain': string;
|
|
205
|
+
'secure': boolean;
|
|
206
|
+
'httponly': boolean;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export interface IUrlParse {
|
|
210
|
+
'protocol': string | null;
|
|
211
|
+
'auth': string | null;
|
|
212
|
+
'user': string | null;
|
|
213
|
+
'pass': string | null;
|
|
214
|
+
'host': string | null;
|
|
215
|
+
'hostname': string | null;
|
|
216
|
+
'port': string | null;
|
|
217
|
+
'pathname': string;
|
|
218
|
+
'path': string | null;
|
|
219
|
+
'query': string | null;
|
|
220
|
+
'hash': string | null;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export interface IModUnionItem {
|
|
224
|
+
'field': string;
|
|
225
|
+
'where'?: any;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// -------------------------
|
|
229
|
+
// -------- zip lib --------
|
|
230
|
+
// -------------------------
|
|
231
|
+
|
|
232
|
+
export interface IZipItem {
|
|
233
|
+
'name': string;
|
|
234
|
+
'compressedSize': number;
|
|
235
|
+
'uncompressedSize': number;
|
|
236
|
+
'date': Date;
|
|
237
|
+
'isFile': boolean;
|
|
238
|
+
'isDirectory': boolean;
|
|
239
|
+
'path': string;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export interface IZipStats {
|
|
243
|
+
'compressedSize': number;
|
|
244
|
+
'uncompressedSize': number;
|
|
245
|
+
'date': Date;
|
|
246
|
+
'isFile': boolean;
|
|
247
|
+
'isDirectory': boolean;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export interface IZipOutputByType {
|
|
251
|
+
'base64': string;
|
|
252
|
+
'string': string;
|
|
253
|
+
'text': string;
|
|
254
|
+
'binarystring': string;
|
|
255
|
+
'array': number[];
|
|
256
|
+
'uint8array': Uint8Array;
|
|
257
|
+
'arraybuffer': ArrayBuffer;
|
|
258
|
+
'blob': Blob;
|
|
259
|
+
'nodebuffer': Buffer;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export type TZipOutputType = keyof IZipOutputByType;
|
|
263
|
+
|
|
264
|
+
export interface IZipInputByType {
|
|
265
|
+
'base64': string;
|
|
266
|
+
'string': string;
|
|
267
|
+
'text': string;
|
|
268
|
+
'binarystring': string;
|
|
269
|
+
'array': number[];
|
|
270
|
+
'uint8array': Uint8Array;
|
|
271
|
+
'arraybuffer': ArrayBuffer;
|
|
272
|
+
'blob': Blob;
|
|
273
|
+
'nodebuffer': Buffer;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export type TZipInputType = keyof IZipInputByType;
|
|
277
|
+
|
|
278
|
+
export type TZipInputFileFormat = IZipInputByType[keyof IZipInputByType];
|
|
279
|
+
|
|
280
|
+
export interface IZipMetadata {
|
|
281
|
+
'percent': number;
|
|
282
|
+
'currentFile': string | null;
|
|
283
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const ctr = __importStar(require("~/sys/ctr"));
|
|
37
|
+
class default_1 extends ctr.Ctr {
|
|
38
|
+
index() {
|
|
39
|
+
return `<a href="${this._config.const.urlBase}test">Hello world! Click here to visit demo.</a>`;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.default = default_1;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const ctr = __importStar(require("~/sys/ctr"));
|
|
37
|
+
class default_1 extends ctr.Ctr {
|
|
38
|
+
onLoad() {
|
|
39
|
+
if (this._config.const.path !== 'test/middle') {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
return '_action: ' + this._action + "<br><br>In fact, the middle method does not exist in the test controller, which uses Kebab's middle structure to preprocess requests.";
|
|
43
|
+
}
|
|
44
|
+
onUnload(rtn) {
|
|
45
|
+
if (!Array.isArray(rtn)) {
|
|
46
|
+
return rtn;
|
|
47
|
+
}
|
|
48
|
+
if (rtn[0] !== -101) {
|
|
49
|
+
return rtn;
|
|
50
|
+
}
|
|
51
|
+
rtn.push({
|
|
52
|
+
'middle': 'unload'
|
|
53
|
+
});
|
|
54
|
+
return rtn;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.default = default_1;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as ctr from '~/sys/ctr';
|
|
2
|
+
import * as types from '~/types';
|
|
3
|
+
|
|
4
|
+
export default class extends ctr.Ctr {
|
|
5
|
+
|
|
6
|
+
public onLoad(): string | boolean {
|
|
7
|
+
if (this._config.const.path !== 'test/middle') {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
return '_action: ' + this._action + "<br><br>In fact, the middle method does not exist in the test controller, which uses Kebab's middle structure to preprocess requests.";
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public onUnload(rtn: string | boolean | types.DbValue[]): string | boolean | types.DbValue[] {
|
|
14
|
+
if (!Array.isArray(rtn)) {
|
|
15
|
+
return rtn;
|
|
16
|
+
}
|
|
17
|
+
if (rtn[0] !== -101) {
|
|
18
|
+
return rtn;
|
|
19
|
+
}
|
|
20
|
+
rtn.push({
|
|
21
|
+
'middle': 'unload'
|
|
22
|
+
});
|
|
23
|
+
return rtn;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|