Axios无法在Mac上运行-已在Vue中安装Safari / Chrome

时间:2020-08-22 17:00:51

标签: php vue.js vuejs2 axios

我一直在寻找了很多,我仍然不知道我做错了,今天我的老板生气地购买Mac图了这一点,IAM的窗户。

在Windows上,对于chrome和moz来说,它可以正常工作,但对safari和chrome的请求失败。

我的请求正在尝试

-获取Cookie ID,并从数据库中收集有关ID的信息,然后返回我的应用。

我的代码

mounted(){
  axios.get('/config/test.php/'+'?nocache='+ new Date().getTime({withCredentials:true})
  .then(resp => this.productsdb = resp.data)
  .then( resp=> {
    this.totiq = this.productsdb.length;
    console.log(resp)
  })             
},

我尝试了什么:

  1. 添加了凭据:true。
  2. '?nocache ='+ new Date()。getTime()->从stackoverflow获得了此溶胶。
  3. 还尝试了fetch()api,没有运气

Php端:

header("Access-Control-Allow-Origin: *");
header('cache-control: no-cache');

0 个答案:

没有答案
相关问题