-
Notifications
You must be signed in to change notification settings - Fork 36
refactor: use async function and support egg@2 #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #15 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 3 3
Lines 53 50 -3
=====================================
- Hits 53 50 -3
Continue to review full report at Codecov.
|
好像这个库没有多文件上传的 fixture ? |
有的,multipart 默认就支持 |
但是之前利用了 generator 可以返回不同的内容实现的,所以可以 |
但这个插件本身好像没有测试多文件的 fixture,要不要加下。 |
有测试多 fields 的,没区别 |
app/extend/context.js
Outdated
8000
@@ -34,9 +33,9 @@ module.exports = { | |||
*/ | |||
getFileStream() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
怎么不直接 async getFileStream() {
@@ -19,30 +19,30 @@ module.exports = function* () { | |||
// 例如 文件是必须字段,那么就报错 | |||
// 这里只是给出提示 | |||
if (!part || !part.filename) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
英文
fixed |
2.0.0 |
Checklist
npm test
passesAffected core subsystem(s)
Description of change
eggjs/egg#1564
此处有要注意的地方,只能通过
await parts()
而不能await parts
来实现获取多个上传文件。但是在 generator function 中,仍然可以使用yield parts