vue_oss
oos upload
demo :
地址: http://sherry255.github.io/vue-oss/
因为跨域(这个demo是用的阿里云文档上给的demo的接口,所以会有跨域)的问题, 必须按照以下操作, demo才能完整展示:
- 安装插件: https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi/reviews?hl=zh-CN
- 启用cors
注: 使用完毕记得关闭cors
Build Setup
# 安装前准备
1. 更换淘宝源:
npm install -g cnpm --registry=https://registry.npm.taobao.org
2. 检查包的更新:
cnpm i -g npm-check-updates
npm-check-updates -u
# 安装
cnpm install
# 修改你的接口:
参考服务端签名后直传文档:https://help.aliyun.com/document_detail/31926.html
将此处( https://github.com/sherrycherish/vue-oss/blob/master/src/components/Upload.vue#L68 )的 serverUrl 换成你的接口地址:
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
# run unit tests
npm run unit
# run e2e tests
npm run e2e
# run all tests
npm test