mm_statics 1.4.6 → 1.4.7
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/index.js +9 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -125,7 +125,6 @@ Statics.prototype.main = async function(ctx, next) {
|
|
|
125
125
|
|
|
126
126
|
/**
|
|
127
127
|
* 执行静态文件处理
|
|
128
|
-
* @method run
|
|
129
128
|
* @param {Object} ctx http请求上下文
|
|
130
129
|
* @param {Function} next 跳过当前执行,先执行后面函数
|
|
131
130
|
* @return {Boolean} 是否执行成功
|
|
@@ -148,13 +147,19 @@ Statics.prototype.run = async function(ctx, next) {
|
|
|
148
147
|
|
|
149
148
|
/**
|
|
150
149
|
* 用于处理静态文件
|
|
151
|
-
* @
|
|
150
|
+
* @param {Object} ctx http请求上下文
|
|
151
|
+
* @param {Function} next 跳过当前执行,先执行后面函数
|
|
152
|
+
* @return {Boolean} 是否执行成功
|
|
152
153
|
*/
|
|
153
154
|
module.exports = function(root, config, es6_to_amd) {
|
|
154
155
|
var static = new Statics(root, config, es6_to_amd);
|
|
155
156
|
if (static.es6_to_amd.files.length > 0) {
|
|
156
|
-
return
|
|
157
|
+
return function(ctx, next) {
|
|
158
|
+
static.main(ctx, next);
|
|
159
|
+
};
|
|
157
160
|
} else {
|
|
158
|
-
return
|
|
161
|
+
return function(ctx, next) {
|
|
162
|
+
static.run(ctx, next);
|
|
163
|
+
};
|
|
159
164
|
}
|
|
160
165
|
};
|