Commit f8163b1d authored by rockyl's avatar rockyl

修复打包问题

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