Vue Cli 3.x |收到CORS错误,代理似乎无济于事

问题描述

我已经这样设置了devServer配置:

devServer: {
    port: 8888,host: "0.0.0.0",proxy: {
        '/api': {
            target: 'http://180.76.249.27:80/weibo/',ws: true,changeOrigin: true,pathRewrite: {
                '^/api': ''
            }
        },}

我这样使用axios:

async loadShowList() {
    let { data } = await axios.$get(
    "http://121.46.19.26:8288/getWeibo/" + this.query
  );
  this.showList = data;

}

但是我一直收到相同的错误

enter image description here

我想知道这是否与axios配置有关。

对此有任何想法吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)