四、Vue中使用axios
  1. 安装包:yarn add axios
  2. 导入axios:import axios from 'axios'
  3. 编写代码请求
var a = axios.create({
  baseURL: 'http://localhost:8080',
  timeout: 1000,
  headers: {
    'X-Custom-Header': 'foobar'
  }
})
  1. 跨域解决方案
    • CORS
    • JSONP
    • 代理服务器
posted on 2022-07-01 19:16  仓鼠不爱吃辣条  阅读(26)  评论(0)    收藏  举报

页尾

页尾

页尾

页尾

页尾

页尾

页尾