DjangoVue前后分离_后端跨域传递参数(搭建博客第二步) yma16 2023-11-15 48 阅读1分钟 Django传递json给Vue get请求 安装django-cors-headers 添加corsheaders应用 添加corsheaders 添加CorsMiddleware 指定ip访问、允许cookie post请求 注释中间件csrf cookie组件使用 安装cookies request简单测试 vue引入axios 登录测试 vue发起post请求 django返回json 注册测试 vue发起post的提交请求