Update ue.js
uniqueId是做什么用的? 如果没什么用,上传图片的时候,如果为空,则创建一个吧,不然,拖动图片到ueditor里无法上传
This commit is contained in:
@@ -9,6 +9,7 @@ var shortid = require('shortid');
|
||||
//图片上传配置
|
||||
var storageImg = multer.diskStorage({
|
||||
destination: function (req, file, cb) {
|
||||
req.query.uniqueId = req.query.uniqueId?req.query.uniqueId:new Date().getTime()+'';
|
||||
if (req.query.uniqueId) {
|
||||
var dirPathParent = path.join(__dirname, '../public/uploads/', req.query.uniqueId),
|
||||
dirPath = path.join(dirPathParent, 'img');//不能直接创建dirPath,因为父目录不存在会抛出异常
|
||||
@@ -222,4 +223,4 @@ router.post('/', function (req, res, next) {
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router;
|
||||
|
||||
Reference in New Issue
Block a user