mm_statics 1.7.5 → 1.7.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/index.js +3 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -677,11 +677,12 @@ Static.prototype._pathToRoot = function (path) {
|
|
|
677
677
|
*/
|
|
678
678
|
Static.prototype.main = async function (ctx, next) {
|
|
679
679
|
let url = ctx.url; // 使用完整URL(包含查询参数)
|
|
680
|
-
|
|
680
|
+
let p = ctx.path;
|
|
681
|
+
if (p.indexOf('.') === -1 || !p.startsWith(this.config.path)) {
|
|
681
682
|
await next();
|
|
682
683
|
return '';
|
|
683
684
|
}
|
|
684
|
-
let path = this._getRealPath(
|
|
685
|
+
let path = this._getRealPath(p);
|
|
685
686
|
|
|
686
687
|
// 检查缓存
|
|
687
688
|
if (await this._handleCache(url, ctx)) {
|