Comments (3)
不仅上传图片
rest api 发出跨域请求,像post,put,delete,options
同样也会出这个错
解决跨域问题,最优方案
修改后端配置
一段golang代码,仅供参考
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
from vue-editor.
谢谢提供的解决方案,关键是我打算浏览器直传阿里云,不经过我们自己的的服务器,所以服务器返回的Header无法控制,只能修改客户端代码。
阿里云oss返回Header:
Access-Control-Allow-Methods:GET, POST, PUT, DELETE, HEAD
Access-Control-Allow-Origin:*
from vue-editor.
阿里云服务器端可配置限定域名上传
from vue-editor.
Related Issues (9)
- You may need an appropriate loader to handle this file type. HOT 2
- 输入时光标总是跳到第一行第一个字符 HOT 1
- 内容被清空 HOT 2
- How to use? HOT 1
- 求救火,哥们,能再这个的基础上增加基于plupload自定义上传吗? HOT 1
- 在使用wangeditor2时的错误 HOT 2
- editor组件中,配置editor.config.menus咋报错。editor.config不存在啊!! HOT 1
- npm 打包的时候font文件的地址是错的 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-editor.