2019-12-12 19:36

你这样写的话每个方法里都得加这个很麻烦,vue 里写个vue.config.js 写了个proxy 设置个api(后台的url) 设置跨域为true 需要的时候调用这个api就可以了,后端不用设置的。