Commit 6ea179a0 authored by 郝聪敏's avatar 郝聪敏

feature: 移除压缩无效代码

parent b266fc0f
module.exports = require('koa-compress');
\ No newline at end of file
......@@ -28,7 +28,7 @@ export default (appInfo: EggAppConfig) => {
config.static = {
prefix: '/public/',
dir: path.join(appInfo.baseDir, 'public'),
// gzip: true
gzip: true
};
config.keys = '123456';
......@@ -42,12 +42,5 @@ export default (appInfo: EggAppConfig) => {
allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH'
};
config.middleware = ['compress']; // 添加compress中间件
// 配置compress
config.compress = {
threshold: 2048 // 超过2048B进行压缩,不写默认为1024B
};
return config;
};
......@@ -12207,30 +12207,6 @@
"any-promise": "^1.1.0"
}
},
"koa-compress": {
"version": "5.0.1",
"resolved": "http://npmprivate.quantgroups.com/koa-compress/-/koa-compress-5.0.1.tgz",
"integrity": "sha512-uTo7Hcyyt6e9o2X3htRS/SNEKy9vDOUc/r1qs/F0YI2Frv9IEbkjz/9dC6IdJWBQAG34lRuU7jBXeq3DRur9Ng==",
"requires": {
"bytes": "^3.0.0",
"compressible": "^2.0.0",
"http-errors": "^1.7.3",
"koa-is-json": "^1.0.0",
"statuses": "^2.0.0"
},
"dependencies": {
"bytes": {
"version": "3.1.0",
"resolved": "http://npmprivate.quantgroups.com/bytes/-/bytes-3.1.0.tgz",
"integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg=="
},
"statuses": {
"version": "2.0.1",
"resolved": "http://npmprivate.quantgroups.com/statuses/-/statuses-2.0.1.tgz",
"integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ=="
}
}
},
"koa-connect": {
"version": "1.0.0",
"resolved": "http://npmprivate.quantgroups.com/koa-connect/-/koa-connect-1.0.0.tgz",
......
......@@ -3,11 +3,9 @@
import 'egg';
import ExportAccess from '../../../app/middleware/access';
import ExportCompress from '../../../app/middleware/compress';
declare module 'egg' {
interface IMiddleware {
access: typeof ExportAccess;
compress: typeof ExportCompress;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment