@rdyl/node-koa-controller 0.0.5 → 0.0.6
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/CHANGELOG.md +1 -1
- package/dist/controller/index.js +20 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/controller/index.js
CHANGED
|
@@ -87,6 +87,7 @@ exports.ASTCache = {
|
|
|
87
87
|
whitelist: [],
|
|
88
88
|
};
|
|
89
89
|
function RegisterASTCacheRoutes(router) {
|
|
90
|
+
var _this = this;
|
|
90
91
|
exports.ASTCache.routes.forEach(function (route) {
|
|
91
92
|
var handlers = route.handlers, prefix = route.prefix, Instance = route.Instance;
|
|
92
93
|
handlers.forEach(function (handler) {
|
|
@@ -97,15 +98,25 @@ function RegisterASTCacheRoutes(router) {
|
|
|
97
98
|
exports.ASTCache.whitelist.push(path);
|
|
98
99
|
}
|
|
99
100
|
// @ts-ignore
|
|
100
|
-
router[method.toLowerCase()](path, function (_ctx) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
101
|
+
router[method.toLowerCase()](path, function (_ctx) { return __awaiter(_this, void 0, void 0, function () {
|
|
102
|
+
var instance, _a;
|
|
103
|
+
return __generator(this, function (_b) {
|
|
104
|
+
switch (_b.label) {
|
|
105
|
+
case 0:
|
|
106
|
+
_b.trys.push([0, 2, , 3]);
|
|
107
|
+
instance = new Instance(_ctx);
|
|
108
|
+
return [4 /*yield*/, instance[name]()];
|
|
109
|
+
case 1:
|
|
110
|
+
_b.sent();
|
|
111
|
+
return [3 /*break*/, 3];
|
|
112
|
+
case 2:
|
|
113
|
+
_a = _b.sent();
|
|
114
|
+
console.log(path + ":配置错误!");
|
|
115
|
+
return [3 /*break*/, 3];
|
|
116
|
+
case 3: return [2 /*return*/];
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}); });
|
|
109
120
|
});
|
|
110
121
|
});
|
|
111
122
|
}
|