django出现OPTIONS请求

tech2025-10-03  2

百度说是跨域的问题 在前端请求的时候加上请求头 (内容类型)

axios.post(url, data, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })

后续出现参数没有序列化的问题,难以提取数据,加入qs模块

https://www.cnblogs.com/dreamzone/p/13081082.html

let data = QS.stringify({ id: this.$route.query.id, gpu: this.gpu, width: screen.width, height: screen.height // urlid:this.$route.query.urlid, });
最新回复(0)