Commit f8163b1d authored by rockyl's avatar rockyl

修复打包问题

parent 45324c04
...@@ -7,9 +7,6 @@ var Eurekaclient = _interopDefault(require('eureka-client-ts')); ...@@ -7,9 +7,6 @@ var Eurekaclient = _interopDefault(require('eureka-client-ts'));
var log4js = require('log4js'); var log4js = require('log4js');
var path = _interopDefault(require('path')); var path = _interopDefault(require('path'));
var fs = _interopDefault(require('fs-extra')); var fs = _interopDefault(require('fs-extra'));
var imagemin = _interopDefault(require('imagemin'));
var imageminJpegtran = _interopDefault(require('imagemin-jpegtran'));
var imageminPngquant = _interopDefault(require('imagemin-pngquant'));
/** /**
* Created by rockyl on 2020-02-13. * Created by rockyl on 2020-02-13.
...@@ -57,8 +54,6 @@ async function getEurekaClient(port) { ...@@ -57,8 +54,6 @@ async function getEurekaClient(port) {
* Created by rockyl on 2020-02-13. * Created by rockyl on 2020-02-13.
*/ */
const acceptTypes = ['image/png', 'image/jpeg'];
function applyApi(server){ function applyApi(server){
server.get('/echo/:name', function (req, res, next) { server.get('/echo/:name', function (req, res, next) {
res.send(req.params); res.send(req.params);
...@@ -71,7 +66,7 @@ function applyApi(server){ ...@@ -71,7 +66,7 @@ function applyApi(server){
}); });
server.post('/tinify', async function (req, res, next) { server.post('/tinify', async function (req, res, next) {
let file = req.files.file; /*let file = req.files.file;
if(file){ if(file){
if(acceptTypes.includes(file.type)){ if(acceptTypes.includes(file.type)){
...@@ -107,7 +102,7 @@ function applyApi(server){ ...@@ -107,7 +102,7 @@ function applyApi(server){
code: 1, code: 1,
msg: 'file not exists' msg: 'file not exists'
}); });
} }*/
return next(); return next();
}); });
......
This diff is collapsed.
...@@ -6,10 +6,6 @@ ...@@ -6,10 +6,6 @@
"dependencies": { "dependencies": {
"eureka-client-ts": "^0.2.10", "eureka-client-ts": "^0.2.10",
"fs-extra": "^8.1.0", "fs-extra": "^8.1.0",
"imagemin": "^7.0.1",
"imagemin-jpegtran": "^6.0.0",
"imagemin-pngquant": "^8.0.0",
"jpegtran-bin": "^4.0.0",
"log4js": "^6.1.2", "log4js": "^6.1.2",
"restify": "^8.5.1" "restify": "^8.5.1"
}, },
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
*/ */
import logger from "./logger"; import logger from "./logger";
import imagemin from "imagemin"; /*import imagemin from "imagemin";
import imageminJpegtran from "imagemin-jpegtran"; import imageminJpegtran from "imagemin-jpegtran";
import imageminPngquant from "imagemin-pngquant"; import imageminPngquant from "imagemin-pngquant";*/
const acceptTypes = ['image/png', 'image/jpeg']; const acceptTypes = ['image/png', 'image/jpeg'];
...@@ -21,7 +21,7 @@ export default function applyApi(server){ ...@@ -21,7 +21,7 @@ export default function applyApi(server){
}); });
server.post('/tinify', async function (req, res, next) { server.post('/tinify', async function (req, res, next) {
let file = req.files.file; /*let file = req.files.file;
if(file){ if(file){
if(acceptTypes.includes(file.type)){ if(acceptTypes.includes(file.type)){
...@@ -57,7 +57,7 @@ export default function applyApi(server){ ...@@ -57,7 +57,7 @@ export default function applyApi(server){
code: 1, code: 1,
msg: 'file not exists' msg: 'file not exists'
}); });
} }*/
return next(); return next();
}); });
......
This diff is collapsed.
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