...
|
...
|
@@ -21,10 +21,11 @@ class FileApi { |
|
|
|
|
|
/**
|
|
|
* 上传到服务器的文件处理
|
|
|
* @param {文件} file
|
|
|
* @param {路径} actPath
|
|
|
* @param {文件} file
|
|
|
* @param {路径} actPath
|
|
|
* @param {用户} user
|
|
|
*/
|
|
|
async upload(file, actPath) {
|
|
|
async upload(file, actPath, user) {
|
|
|
let fileName = _.get(file, 'name');
|
|
|
let fileNameWithoutType = _.split(fileName, '.')[0];
|
|
|
let fileSavePath = path.join(FILE_SAVE_ROOT_PATH, fileName); // 文件保存到服务器的路径
|
...
|
...
|
@@ -71,7 +72,8 @@ class FileApi { |
|
|
date: moment().format('YYYY-MM-DD HH:mm'),
|
|
|
fileName: fileName,
|
|
|
actPath: actPath,
|
|
|
username: '' // TODO
|
|
|
username: user.username,
|
|
|
user_id: user._id
|
|
|
});
|
|
|
|
|
|
await this._uploadToQiniu(fileList, fileDistPath);
|
...
|
...
|
|