Authored by 姜敏

图片上传(单张 修改)

... ... @@ -105,6 +105,7 @@ exports.uploadFile = function (req, res) {
res.json(errBackMsg);
});
} else {
req.body.file = fs.createReadStream(req.files[req.body.filename].path);
request.post({
url: domain + '/fileupload/upload',
formData: req.body
... ... @@ -166,7 +167,7 @@ function joinimg(url) {
exports.ueditor = function(req, res) {
var headers = {};
if (req.session && req.session.user) {
var ipObject = ipaddr.process(req.ip).octets
var ipObject = ipaddr.process(req.ip).octets;
var ip = ipObject ? ipObject.join('.') : req.ip;
headers = {
... ... @@ -182,8 +183,6 @@ exports.ueditor = function(req, res) {
message: "用户失效,请重新登录"
});
}
console.log(req.files);
if (req.is("multipart/form-data")) {
req.body.file = fs.createReadStream(req.files.upfile.path);
req.body.bucket="goodsimg";
... ...