Skip to content
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

使用element-ui上传图片+附加参数用egg接收问题 #89

Open
lizhongzhen11 opened this issue Apr 26, 2020 · 0 comments
Open

使用element-ui上传图片+附加参数用egg接收问题 #89

lizhongzhen11 opened this issue Apr 26, 2020 · 0 comments

Comments

@lizhongzhen11
Copy link
Owner

首先是上传图片大小规格限制问题,看:https://blog.csdn.net/struggleThunder/article/details/80417953

然后,我想传递用户编号,通过后台改上传图片的名字时,不知道怎么搞了。

我用的是 ctx.getFileStream(),其实这个我并不了解,但是得解决它,然后在这里:https://blog.csdn.net/liruiqing520/article/details/99709908 看到原因。

知道原因后我直接在官方 issue 中查,发现 上传图片,获取formdata里面的参数问题 里就有我想要的,我直接在 service 层通过以下代码就拿到附加的 data 数据了:

const userId = stream.fields.userId
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant