Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

关于七牛云文件的上传 #9

Closed
Hjyheart opened this issue May 2, 2017 · 5 comments
Closed

关于七牛云文件的上传 #9

Hjyheart opened this issue May 2, 2017 · 5 comments

Comments

@Hjyheart
Copy link

Hjyheart commented May 2, 2017

您好,看了您的代码,觉得很屌,很是震撼。但是有个小小的疑问我不是很懂。就是那个七牛云上传为什么要写三个按钮。我尝试去用正常的脑回路上传文件,发现并不行,然后抄了您的代码就可以了,我很是不解,希望您可以解答我心中的疑惑。

@surmon-china
Copy link
Owner

你指这个吗?
https://github.com/surmon-china/angular-admin/blob/master/src/app/theme/components/baPictureUploader/baPictureUploader.html

其实就两个事件:

  • 删除当前图片(已上传图片)
  • 重新上传图片/或者说是上传图片

@Hjyheart
Copy link
Author

Hjyheart commented May 3, 2017

是 是这段代码 我不懂为什么这边要用到三个按钮 七牛云sdk绑定的那个按钮甚至都没有用 第一个按钮的点击事件只是去模拟点击第二个隐藏的按钮 就不是很懂这个逻辑 但不这么做似乎又传不上文件 就来讨教一下这个“三按钮”大法的原理

@surmon-china
Copy link
Owner

另外,七牛云sdk提供的按钮确实没用上,而是直接调用了七牛云sdk的上传文件api。

代码在此:https://github.com/surmon-china/angular-admin/blob/master/src/app/theme/components/baPictureUploader/baPictureUploader.component.ts#L146

@Hjyheart
Copy link
Author

Hjyheart commented May 4, 2017

非常感谢

@surmon-china surmon-china pinned this issue Jul 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants