|
@@ -482,7 +482,8 @@ module.exports = app => {
|
|
|
const parts = ctx.multipart({ autoFields: true });
|
|
|
const paths = [];
|
|
|
let index = 0;
|
|
|
- while ((stream = await parts()) !== undefined) {
|
|
|
+ stream = await parts();
|
|
|
+ while (stream !== undefined) {
|
|
|
// 判断用户是否选择上传文件
|
|
|
if (!stream.filename) {
|
|
|
throw '请选择上传的文件!';
|
|
@@ -497,6 +498,11 @@ module.exports = app => {
|
|
|
}
|
|
|
paths.push(filepath);
|
|
|
++index;
|
|
|
+ if (Array.isArray(parts.field.size) && index < parts.field.size.length) {
|
|
|
+ stream = await parts();
|
|
|
+ } else {
|
|
|
+ stream = undefined;
|
|
|
+ }
|
|
|
}
|
|
|
// 获取账号数据
|
|
|
const accountData = await ctx.service.projectAccount.getDataByCondition({ id: ctx.session.sessionUser.accountId });
|