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

feat(http-request): 可自定义上传函数 #103

Merged
merged 16 commits into from
Oct 12, 2019

Conversation

eviIIt
Copy link
Contributor

@eviIIt eviIIt commented Oct 12, 2019

Why

  • 安全性问题: oss 配置信息仍可在 sources 查看
  • 需求: 私有化部署上传到私有服务器, 并非 ali-oss.

New

props.httpRequest

TODO

  • http-request: function
  • 使用 CDN 加载 ali-oss.sdk

How

  1. 新增 prop: http-request 接收函数, 命名来源参考 el-upload
  2. http-request 函数需要返回 promise
    2.1 resolve 为上传完成, 接收 url 参数, 代表该文件 url, 用于提供组件预览.
  3. 存在 http-request 则不创建 AliOSS 实例

Test

http-request1

模拟 http 请求, 并返回 url

Docs

  • http-request.md

A function to customize the default upload behavior
@auto-add-label auto-add-label bot added the enhancement New feature or request label Oct 12, 2019
@netlify
Copy link

netlify bot commented Oct 12, 2019

Deploy preview for upload-to-ali ready!

Built with commit 631f709

https://deploy-preview-103--upload-to-ali.netlify.com

@eviIIt eviIIt marked this pull request as ready for review October 12, 2019 07:07
@levy9527 levy9527 changed the title feat: 可自定义上传函数 feat(http-request): 可自定义上传函数 Oct 12, 2019
@levy9527 levy9527 merged commit a184099 into FEMessage:dev Oct 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants